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)
Beispiel #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)
Beispiel #3
0
 def add_menu(self, commands, name, function):
     new_menu = SimpleMenu()
     for command in commands:
         new_menu.add(command, function)
     self.menubar.append(new_menu, name)
Beispiel #4
0
def make_menu(options, function, name='_none_'):
    menu = SimpleMenu()
    menu.set_name(name)
    for option in options:
        menu.add(option, function)
    return menu
Beispiel #5
0
 def __make_menu__(self, options, function):
     menu = SimpleMenu()
     for option in options:
         menu.add(option, function)
     return menu
def make_menu(options, function, name='_none_'):
    menu = SimpleMenu()
    menu.set_name(name)
    for option in options:
        menu.add(option, function)
    return menu
 def add_menu_orig(self, commands, name, function):
     new_menu = SimpleMenu()
     for command in commands:
         new_menu.add(command, function)
     self.menubar.append(new_menu, name)
 def __make_menu__(self, options, function):
     menu = SimpleMenu()
     for option in options:
         menu.add(option, function)
     return menu