def addmenu(): global _menu global _menuItems with mayautils.undo_on_error(): _menu = pmc.menu('HDR Interpolation', parent=mayautils.get_main_window_name()) item = pmc.menuItem(parent=_menu, label='Show Menu', command=show) _menuItems.append(item)
def make_test_items(): menu = pmc.menu( 'DemoMenu', parent=mayautils.get_main_window_name()) def makeitem(ind): def callback(_): print 'Item', ind item = pmc.menuItem( parent=menu, label='Item %s' % ind, command=callback) register_menuitem(item.name()) for i in range(5): makeitem(i)
def demo1_createmenu(): import mayautils menu = pmc.menu('DemoMenu', parent=mayautils.get_main_window_name()) def callback(_): print 'Hello, reader!' menuitem = pmc.menuItem(parent=menu, label='Greet', command=callback) print repr(menuitem) # ui.SubMenuItem('MayaWindow|DemoMenu|menuItem254') return menuitem
def demo1_createmenu(): import mayautils menu = pmc.menu( 'DemoMenu', parent=mayautils.get_main_window_name()) def callback(_): print 'Hello, reader!' menuitem = pmc.menuItem( parent=menu, label='Greet', command=callback) print repr(menuitem) # ui.SubMenuItem('MayaWindow|DemoMenu|menuItem254') return menuitem