Lines Matching full:menu
20 from Carbon.Menu import *
131 self.filemenu = m = Menu(self.menubar, "File")
450 """Represent a set of menus in a menu bar.
511 menu = self.menus[m]
512 if menu.__class__ == FrameWork.AppleMenu:
514 for i in range(len(menu.items)):
515 label, shortcut, callback, kind = menu.items[i]
521 menu.menu.EnableMenuItem(i + 1)
523 menu.menu.EnableMenuItem(i + 1)
525 menu.menu.DisableMenuItem(i + 1)
527 menu.menu.EnableMenuItem(i + 1)
529 menu.menu.DisableMenuItem(i + 1)
543 class Menu: class
544 "One menu."
548 self.id, self.menu = self.bar.addmenu(title, after, id)
556 self.menu.DisposeMenu()
559 del self.menu
564 self.menu.AppendMenu('x') # add a dummy string
568 self.menu.SetMenuItemTextWithCFString(item, label)
570 self.menu.SetMenuItemText(item, label)
573 self.menu.SetItemCmd(item, ord(char))
574 self.menu.SetMenuItemModifiers(item, modifiers)
576 self.menu.SetMenuItemKeyGlyph(item, shortcut[2])
578 self.menu.SetItemCmd(item, ord(shortcut))
583 raise 'Can only delete last item of a menu'
584 self.menu.DeleteMenuItem(item)
594 self.menu.AppendMenu('(-')
598 sub = Menu(self.bar, title, -1)
600 self.menu.SetItemMark(item, sub.id)
621 # since the menu item should have been disabled...
627 # since the menu item should have been disabled...
633 self.menu.EnableMenuItem(0)
635 self._parent.menu.EnableMenuItem(self._parent_item)
637 self.menu.DisableMenuItem(0)
639 self._parent.menu.DisableMenuItem(self._parent_item)
643 class PopupMenu(Menu):
645 Menu.__init__(self, bar, '(popup)', -1)
651 reply = self.menu.PopUpMenuSelect(x, y, default)
665 def __init__(self, menu, title, shortcut=None, callback=None, kind=None): argument
666 self.item = menu.additem(title, shortcut, callback)
667 self.menu = menu
670 self.menu.delitem(self.item)
671 del self.menu
675 self.menu.menu.CheckMenuItem(self.item, onoff)
679 self.menu.menu.EnableMenuItem(self.item)
681 self.menu.menu.DisableMenuItem(self.item)
684 self.menu.menu.SetMenuItemText(self.item, text)
687 self.menu.menu.SetItemStyle(self.item, style)
690 self.menu.menu.SetItemIcon(self.item, icon)
693 self.menu.menu.SetItemCmd(self.item, cmd)
696 self.menu.menu.SetItemMark(self.item, cmd)
700 def __init__(self, menu, title, shortcut=None, callback=None): argument
701 MenuItem.__init__(self, menu, title, shortcut, callback, 'radio')
704 def __init__(self, menu, title, shortcut=None, callback=None): argument
705 MenuItem.__init__(self, menu, title, shortcut, callback, 'check')
707 def Separator(menu): argument
708 menu.addseparator()
710 def SubMenu(menu, label, title=''): argument
711 return menu.addsubmenu(label, title)
714 class AppleMenu(Menu):
717 Menu.__init__(self, bar, "\024", id=SIOUX_APPLEMENU_ID)
721 self.menu.AppendResMenu('DRVR')
723 # Additem()'s tricks do not work for "apple" menu under Carbon
724 self.menu.InsertMenuItem(abouttext, 0)
729 Menu.dispatch(self, id, item, window, event)
731 name = self.menu.GetMenuItemText(item)
734 class HelpMenu(Menu):
736 # Note we don't call Menu.__init__, we do the necessary things by hand
738 self.menu, index = HMGetHelpMenu()
739 self.id = self.menu.GetMenuID()
1088 self.filemenu = m = Menu(self.menubar, "File")