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_menu(self, commands, name, function, radio=False):
     if radio:
         new_menu = RadioMenu(commands, function)
     else:
         new_menu = SimpleMenu()
         for command in commands:
             new_menu.add(command, function)
     self.menubar.append(new_menu, name)
Esempio n. 4
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)
Esempio n. 5
0
def make_menu(options, function, name='_none_'):
    menu = SimpleMenu()
    menu.set_name(name)
    for option in options:
        menu.add(option, function)
    return menu
Esempio n. 6
0
 def __make_menu__(self, options, function):
     menu = SimpleMenu()
     for option in options:
         menu.add(option, function)
     return menu
Esempio n. 7
0
def make_menu(options, function, name='_none_'):
    menu = SimpleMenu()
    menu.set_name(name)
    for option in options:
        menu.add(option, function)
    return menu
Esempio n. 8
0
 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)
Esempio n. 9
0
 def __make_menu__(self, options, function):
     menu = SimpleMenu()
     for option in options:
         menu.add(option, function)
     return menu