本文整理汇总了Python中tkinter.Menu.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python Menu.__init__方法的具体用法?Python Menu.__init__怎么用?Python Menu.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tkinter.Menu
的用法示例。
在下文中一共展示了Menu.__init__方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from tkinter import Menu [as 别名]
# 或者: from tkinter.Menu import __init__ [as 别名]
def __init__(self, parent):
Menu.__init__(self, parent)
self.parent = parent
menu_file = Menu(self, tearoff=0)
menu_file.add_command(compound='left',
image=icons['actions']['new']['generic'], label='New...', command=new_file)
menu_file.add_command(compound='left',
image=icons['actions']['open']['file'], label='Open...', command=open_files)
menu_file.add_command(compound='left',
image=icons['actions']['open']['folder'], label='Open Folder...', command=open_folder)
menu_file.add_command(compound='left',
image=icons['actions']['open']['mc_folder'],
label='Open Minecraft Save Folder...', command=open_mc_dir)
menu_file.add_separator()
menu_file.add_command(compound='left', image=icons['actions']['save'], label='Save...', command=save_files)
menu_file.add_command(compound='left', image=icons['actions']['refresh'],
label='Refresh', command=refresh_files)
menu_file.add_separator()
menu_file.add_command(compound='left', image=icons['actions']['exit'], label='Exit', command=root.quit)
menu_edit = Menu(self, tearoff=0)
menu_edit.add_command(compound='left', image=icons['actions']['copy'], label='Copy')
menu_edit.add_command(compound='left', image=icons['actions']['cut'], label='Cut')
menu_edit.add_command(compound='left', image=icons['actions']['paste'], label='Paste')
menu_edit.add_separator()
menu_edit.add_command(compound='left', image=icons['actions']['rename'], label='Rename')
menu_edit.add_command(compound='left', image=icons['actions']['edit'], label='Edit')
menu_edit.add_command(compound='left', image=icons['actions']['delete'], label='Delete')
menu_edit.add_separator()
menu_edit.add_command(compound='left', image=icons['actions']['move']['up'], label='Move Up')
menu_edit.add_command(compound='left', image=icons['actions']['move']['down'], label='Move Down')
menu_search = Menu(self, tearoff=0)
menu_search.add_command(compound='left', image=icons['actions']['search'], label='Find')
menu_search.add_command(compound='left', image=icons['actions']['move']['right'], label='Find Next')
menu_search.add_separator()
menu_search.add_command(compound='left', image=icons['actions']['replace'], label='Replace')
menu_search.add_separator()
menu_search.add_command(compound='left', image=icons['actions']['chunk_find'], label='Chunk Finder')
menu_help = Menu(self, tearoff=0)
menu_help.add_command(compound='left', image=icons['about'], label='About')
self.add_cascade(label='File', menu=menu_file)
self.add_cascade(label='Edit', menu=menu_edit)
self.add_cascade(label='Search', menu=menu_search)
self.add_cascade(label='Help', menu=menu_help)
示例2: __init__
# 需要导入模块: from tkinter import Menu [as 别名]
# 或者: from tkinter.Menu import __init__ [as 别名]
def __init__(self, parent):
Menu.__init__(self, parent)
self.parent = parent
self.newmenu = Menu(self)
self.showmenu = Menu(self)
self.newmenu.add_command(label="NPC", command=self.parent.onNew)
self.newmenu.add_separator()
self.newmenu.add_command(label="Save", command=self.parent.save)
self.newmenu.add_command(label="Load", command=self.parent.load)
self.showmenu.add_command(label="Info", command=self.parent.get_info)
self.newmenu.add_separator()
self.showmenu.add_separator()
self.add_cascade(label="New", menu=self.newmenu)
self.add_cascade(label="Show", menu=self.showmenu)
self.add_command(label="Exit", command=self.parent.quit)
示例3: __init__
# 需要导入模块: from tkinter import Menu [as 别名]
# 或者: from tkinter.Menu import __init__ [as 别名]
def __init__(self, master=None):
Menu.__init__(self)
self = Menu(master)
filemenu = Menu(self, tearoff=False)
filemenu.add_command(label="Open")
self.add_cascade(menu=filemenu, label="File")
windowmenu = Menu(self, name="window", tearoff=False)
self.add_cascade(menu=windowmenu, label="Window")
helpmenu = Menu(self, name="help", tearoff=False)
self.add_cascade(menu=helpmenu, label="Help")
master['menu'] = self
示例4: __init__
# 需要导入模块: from tkinter import Menu [as 别名]
# 或者: from tkinter.Menu import __init__ [as 别名]
def __init__(self, parent,delegate):
Menu.__init__(self, parent)
self.parent = parent
self.delegate = delegate
self.initUI()
self.toggleBooleanButtonStates = []
示例5: __init__
# 需要导入模块: from tkinter import Menu [as 别名]
# 或者: from tkinter.Menu import __init__ [as 别名]
def __init__(self, parent,delegate):
Menu.__init__(self, parent)
self.delegate = delegate
self.initUI()