当前位置: 首页>>代码示例>>Python>>正文


Python Menu.__init__方法代码示例

本文整理汇总了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)
开发者ID:ievans3024,项目名称:PyNBTx,代码行数:52,代码来源:__init__.py

示例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)
开发者ID:Exodus111,项目名称:Projects,代码行数:17,代码来源:load.py

示例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
开发者ID:garthreckers,项目名称:p01-desktop,代码行数:18,代码来源:mainmenu.py

示例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 = []
开发者ID:RohanBali,项目名称:EGUANA_Python,代码行数:8,代码来源:egmenu.py

示例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()
开发者ID:VrishtiDutta,项目名称:EGUANA_Python,代码行数:7,代码来源:egmenu.py


注:本文中的tkinter.Menu.__init__方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。