Esempio n. 1
0
def populate_menu(mainmenu, section, commands, function):
    new_menu = SimpleMenu()
    section_item = MenuItem(section)
    section_item.set_name(section)
    section_item.show()
    section_item.set_submenu(new_menu)
    mainmenu.append(section_item)
    for command in commands:
        new_menu.add(command, function, section_item)
Esempio n. 2
0
def populate_menu(mainmenu, section, commands, function):
    new_menu = SimpleMenu()
    section_item = MenuItem(section)
    section_item.set_name(section)
    section_item.show()
    section_item.set_submenu(new_menu)
    mainmenu.append(section_item)
    for command in commands:
        new_menu.add(command, function, section_item)
Esempio n. 3
0
 def add(self, label, function, menu=None):
     item = MenuItem(label)
     item.set_name(label)
     self.append(item)
     if menu:
         item.connect('activate', function, label, menu)
     else:
         item.connect('activate', function, label)
     item.show()
     self._menu_dict[label] = item
Esempio n. 4
0
 def add(self, label, function, menu=None):
     item = MenuItem(label)
     item.set_name(label)
     self.append(item)
     if menu:
         item.connect('activate', function, label, menu)
     else:
         item.connect('activate', function, label)
     item.show()
     self._menu_dict[label] = item
Esempio n. 5
0
 def append(self, menu, name):
     item = MenuItem(name)
     item.show()
     item.set_submenu(menu)
     MenuBar.append(self, item)
     self._menu_dict[name] = menu
Esempio n. 6
0
 def append(self, menu, name):
     item = MenuItem(name)
     item.show()
     item.set_submenu(menu)
     MenuBar.append(self, item)
     self._menu_dict[name] = menu