[docs]defget_menu(self):self.menubar=gtk.MenuBar()# Menu filemenu_file=gtk.Menu()menu_file_m=gtk.MenuItem("File")menu_file_m.set_submenu(menu_file)menu_exit=gtk.MenuItem("Close")menu_exit.connect("activate",self.cells.hide_show_change)menu_file.append(menu_exit)# Menu Cellmenu_cell_m=gtk.MenuItem('Cell')menu_cell=gtk.Menu()menu_cell_m.set_submenu(menu_cell)menu_neww=gtk.MenuItem("New cell")menu_cell.append(menu_neww)menu_new=gtk.Menu()menu_neww.set_submenu(menu_new)menu_new_rect_tp=gtk.MenuItem("Rectangle (two opposite edges)")menu_new_rect_ct=gtk.MenuItem('Rectangle (center and edge)')menu_new_pol=gtk.MenuItem("Polygon")menu_new.append(menu_new_rect_tp)menu_new.append(menu_new_rect_ct)menu_new.append(menu_new_pol)menu_new_rect_tp.connect('activate',self.new_cell,'rect_tp')menu_new_rect_ct.connect('activate',self.new_cell,'rect_ct')menu_new_pol.connect('activate',self.new_cell,'pol')# Menu Cells#menu_cells = gtk.Menu()#menu_cells_m = gtk.MenuItem("Cells")#menu_cells_m.set_submenu(menu_cells)#menu_hideshow_c = gtk.MenuItem("Show/Hide cells")#menu_hideshow_p = gtk.MenuItem("Show/Hide cells panel")#menu_hideshow_c.connect("activate", self.tmp)#menu_hideshow_p.connect("activate", self.show_hide_cells_panel)#menu_cells.append(menu_hideshow_c)#menu_cells.append(menu_hideshow_p)self.menubar.append(menu_file_m)self.menubar.append(menu_cell_m)#self.menubar.append(menu_cells_m)self.menubar.show_all()returnself.menubar
[docs]defnew_cell(self,w,celltype):"""Callback binding function"""self.cells.hide_show_new_cell_panel(celltype)logging.info("Instanciating a new cell of type: %s",celltype)returnTrue
Quick search
Enter search terms or a module, class or function name.