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


Python Menu.add_separator方法代码示例

本文整理汇总了Python中tkinter.Menu.add_separator方法的典型用法代码示例。如果您正苦于以下问题:Python Menu.add_separator方法的具体用法?Python Menu.add_separator怎么用?Python Menu.add_separator使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在tkinter.Menu的用法示例。


在下文中一共展示了Menu.add_separator方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: add_menubar

# 需要导入模块: from tkinter import Menu [as 别名]
# 或者: from tkinter.Menu import add_separator [as 别名]
def add_menubar( root ):
	menubar = Menu(root)

	#file menu
	filemenu = Menu(menubar, tearoff=0)
	# filemenu.add_command( label="Load project", command=build_in_progress )
	# filemenu.add_command( label="Save project", command=build_in_progress )
	filemenu.add_separator()
	filemenu.add_command( label="Exit", command=root.quit )

	menubar.add_cascade( label="File", menu=filemenu )

	#view menu
	viewmenu = Menu(menubar, tearoff=0)
	viewmenu.add_command( label="Progress", command=root.progress )
	viewmenu.add_command( label="Workflow", command=root.workflow )

	menubar.add_cascade( label="View", menu=viewmenu )

	#help menu
	helpmenu = Menu(menubar, tearoff=0)
	helpmenu.add_command( label="Help", command=build_in_progress )
	helpmenu.add_separator()
	helpmenu.add_command( label="About", command=about )

	menubar.add_cascade(label="Help", menu=helpmenu )
	
	root.config( menu=menubar )
开发者ID:jlac,项目名称:Pipeliner,代码行数:30,代码来源:menu.py

示例2: initUI

# 需要导入模块: from tkinter import Menu [as 别名]
# 或者: from tkinter.Menu import add_separator [as 别名]
    def initUI(self):
        self.parent.title("Mario's Picross Puzzle Editor")
        self.puzzles = None

        # Build the menu
        menubar = Menu(self.parent)
        self.parent.config(menu=menubar)
        fileMenu = Menu(menubar)
        self.fileMenu = fileMenu
        fileMenu.add_command(label="Open Mario's Picross ROM...",
                              command=self.onOpen)
        fileMenu.add_command(label="Save ROM as...",
                             command=self.onSave,
                             state=DISABLED)
        fileMenu.add_separator()
        fileMenu.add_command(label="Exit", command=self.onExit)
        menubar.add_cascade(label="File", menu=fileMenu)

        # Navigation
        Label(self.parent).grid(row=0, column=0)
        Label(self.parent).grid(row=0, column=4)
        self.parent.grid_columnconfigure(0, weight=1)
        self.parent.grid_columnconfigure(4, weight=1)

        prevButton = Button(self.parent,
                            text="<--",
                            command=self.onPrev,
                            state=DISABLED
        )
        self.prevButton = prevButton
        prevButton.grid(row=0, column=1)

        puzzle_number = 1
        self.puzzle_number = puzzle_number
        puzzleNumber = Label(self.parent, text="Puzzle #{}".format(puzzle_number))
        self.puzzleNumber = puzzleNumber
        puzzleNumber.grid(row=0, column=2)

        nextButton = Button(self.parent,
                            text="-->",
                            command=self.onNext,
                            state=DISABLED
        )
        self.nextButton = nextButton
        nextButton.grid(row=0, column=3)

        # Canvas
        canvas = Canvas(self.parent)
        self.canvas = canvas
        for i in range(15):
            for j in range(15):
                fillcolor = "gray80"
                self.canvas.create_rectangle(10+20*j,     10+20*i,
                                             10+20*(j+1), 10+20*(i+1),
                                             fill=fillcolor,
                                             tags="{},{}".format(i, j)
                )
        self.canvas.bind("<ButtonPress-1>", self.onClick)
        canvas.grid(row=1, columnspan=5, sticky=W+E+N+S)
        self.parent.grid_rowconfigure(1, weight=1)
开发者ID:sopoforic,项目名称:cgrr-mariospicross,代码行数:62,代码来源:marios_picross_puzzle_editor_gui.py

示例3: setupMenubar

# 需要导入模块: from tkinter import Menu [as 别名]
# 或者: from tkinter.Menu import add_separator [as 别名]
 def setupMenubar(self, root):
   menubar = Menu(root)
   filemenu = Menu(menubar, tearoff=0)
   filemenu.add_command(label="New", command=donothing(root))
   filemenu.add_command(label="Open", command=donothing(root))
   filemenu.add_command(label="Save", command=donothing(root))
   filemenu.add_command(label="Save as...", command=donothing(root))
   filemenu.add_command(label="Close", command=donothing(root))
   
   filemenu.add_separator()
   
   filemenu.add_command(label="Exit", command=root.quit)
   menubar.add_cascade(label="File", menu=filemenu)
   editmenu = Menu(menubar, tearoff=0)
   editmenu.add_command(label="Undo", command=donothing(root))
   
   editmenu.add_separator()
   
   editmenu.add_command(label="Cut", command=donothing(root))
   editmenu.add_command(label="Copy", command=donothing(root))
   editmenu.add_command(label="Paste", command=donothing(root))
   editmenu.add_command(label="Delete", command=donothing(root))
   editmenu.add_command(label="Select All", command=donothing(root))
   
   menubar.add_cascade(label="Edit", menu=editmenu)
   helpmenu = Menu(menubar, tearoff=0)
   helpmenu.add_command(label="Help Index", command=donothing(root))
   helpmenu.add_command(label="About...", command=donothing(root))
   menubar.add_cascade(label="Help", menu=helpmenu)
   
   root.config(menu=menubar)
   root.mainloop() 
开发者ID:JayRod12,项目名称:py-a-thon,代码行数:34,代码来源:gui.py

示例4: __init__

# 需要导入模块: from tkinter import Menu [as 别名]
# 或者: from tkinter.Menu import add_separator [as 别名]
 def __init__(self, master=None):
     Frame.__init__(self, master)
     self.pack(expand=1, fill='both')
     self.master.geometry('1440x900')
     paned_window = PanedWindow(self)
     self.treeview_kspelements = TreeviewKSPElements(self)
     self.treeview_kspobjects = TreeviewKSPObjects(self)
     paned_window.pack(expand=1, fill='both')
     paned_window.add(self.treeview_kspelements)
     paned_window.add(self.treeview_kspobjects)
     
     menubar = Menu(self)
     
     filemenu = Menu(self)
     filemenu.add_command(label='Open', command=self._open)
     filemenu.add_command(label='Save', command=self._save)
     filemenu.add_command(label='Save As', command=self._save_as)
     filemenu.add_separator()
     filemenu.add_command(label='Exit', command=self.master.destroy)
     menubar.add_cascade(menu=filemenu, label='File')
     
     insertmenu = Menu(self)
     insertmenu.add_command(label='KSP Element', command=self._insert_element, state='disabled')
     insertmenu.add_command(label='KSP Object', command=self._insert_object)
     menubar.add_cascade(menu=insertmenu, label='Insert')
     self.master.config(menu=menubar)
开发者ID:dan2082,项目名称:KSPData,代码行数:28,代码来源:main.py

示例5: handle_button_click

# 需要导入模块: from tkinter import Menu [as 别名]
# 或者: from tkinter.Menu import add_separator [as 别名]
    def handle_button_click(self, event):

        val = self.button_selected.get() - 1
        val = self.radio_buttons.index(event.widget)
        if event.state & 0x001:  # Shift key down
            self.x_flipped[val] = not self.x_flipped[val]
            try:
                raise IOError
                image_file = imget(self.img_lists[val][self.images_selected[val]])
                import_image = Image.open(image_file)
            except IOError:
                image_file = imget_bdgp(self.img_lists[val][self.images_selected[val]])
                import_image = Image.open(image_file)
                import_image = import_image.resize((180,80), Image.ANTIALIAS)
            import_image = import_image.rotate(180*self.x_flipped[val])
            embryo_image = ImageTk.PhotoImage(import_image)
            label = Label(image=embryo_image)
            label.image = embryo_image
            self.radio_buttons[val].configure(
                #text=image_file,
                image=label.image,
            )
        elif event.state & 0x004: # Control key down
            popup = Menu(root, tearoff=0)
            popup.add_command(label=self.radio_buttons[val].cget('text'))
            popup.add_separator()
            popup.add_command(label="Invert X")
            popup.add_command(label="Invert Y")
            try:
                popup.tk_popup(event.x_root, event.y_root, 0)
            finally:
                # make sure to release the grab (Tk 8.0a1 only)
                popup.grab_release()

        elif val >= 0:
            self.images_selected[val] = ((self.images_selected[val] + 2*event.num
                                         - 3) %
                                         len(self.img_lists[val]))
            self.x_flipped[val] = False
            if self.images_selected[val] == 0:
                stdout.write('\a')
                stdout.flush()

            try:
                raise IOError
                image_file = imget(self.img_lists[val][self.images_selected[val]])
                import_image = Image.open(image_file)
            except IOError:
                image_file = imget_bdgp(self.img_lists[val][self.images_selected[val]])
                import_image = Image.open(image_file)
                import_image = import_image.resize((180,80), Image.ANTIALIAS)
            embryo_image = ImageTk.PhotoImage(import_image)
            label = Label(image=embryo_image)
            label.image = embryo_image
            self.radio_buttons[val].configure(
                #text=image_file,
                image=label.image,
            )
            self.image_files[val] = image_file
        self.button_selected.set(-1)
开发者ID:petercombs,项目名称:EisenLab-Code,代码行数:62,代码来源:MakeInSituTable.py

示例6: FrontEnd

# 需要导入模块: from tkinter import Menu [as 别名]
# 或者: from tkinter.Menu import add_separator [as 别名]
class FrontEnd(Frame):
    def __init__(self, master, version):
        Frame.__init__(self, master)
        master.title(version[:-5])
        # MAKE IT LOOK GOOD
        style = Style()
        style.configure("atitle.TLabel", font="tkDefaultFont 12 bold italic")

        # CREATE AND SET VARIABLES
        self.version = version
        self.description = None
        self.logo = None
        self.status_lbl = StringVar()  # TO HOLD STATUS VARIABLE IN STATUSBAR

        # CREATE ROOT MENUBAR
        menubar = Menu(self.master)
        self.master["menu"] = menubar
        self.master.option_add("*tearOff", False)
        # CREATE FILE MENU
        self.menu_file = Menu(menubar, name="file")
        self.menu_file.add_separator()
        self.menu_file.add_command(label="Exit", accelerator="Alt-F4", command=self.master.destroy)
        menubar.add_cascade(menu=self.menu_file, label="File", underline=0)
        # CREATE HELP MENU
        menu_help = Menu(menubar, name="help")
        menu_help.add_command(label="About", command=self.show_about)
        menubar.add_cascade(menu=menu_help, label="Help", underline=0)

        # CREATE BUTTON BAR
        self.button_bar = Frame(self.master, relief="groove", padding="0 1 0 2")
        self.button_bar.grid(sticky="ew")

        # SETUP PRIMARY FRAME FOR WIDGETS
        self.frame = Frame(self.master, padding="25")
        self.frame.grid(sticky="nsew")

        # CREATE STATUS BAR
        Separator(self.master).grid(row=8, sticky="ew")
        self.status_bar = Frame(self.master, padding="8 0 0 1")
        self.status_bar.grid(row=9, sticky="ews")
        Label(self.status_bar, textvariable=self.status_lbl).grid(row=0, column=0, padx="0 7")
        Label(self.status_bar, text=self.version[-5:]).grid(row=0, column=8)
        Sizegrip(self.status_bar).grid(row=0, column=9, sticky="e")

        # CONFIGURE AUTO-RESIZING
        self.master.columnconfigure(0, weight=1)
        self.master.rowconfigure(1, weight=1)
        self.frame.columnconfigure(0, weight=1)
        # self.frame.rowconfigure(0, weight=1)
        self.status_bar.columnconfigure(1, weight=1)

    def show_about(self):
        about = About(self.master, "About {}".format(self.version[:-5]), self.logo)
        Label(about.frame, text=self.version, style="atitle.TLabel").grid(sticky="w")
        Label(about.frame, text="Developer:  Joel W. Dafoe").grid(pady="6", sticky="w")
        link = Link(about.frame, text="http://cyberdatx.com", foreground="blue", cursor="hand2")
        link.grid(sticky="w")
        link.bind("<Button-1>", lambda e: webbrowser.open("http://cyberdatx.com"))
        Label(about.frame, text=self.description, wraplength=292).grid(columnspan=2, pady=6, sticky=W)
开发者ID:jwdafoe,项目名称:ContactPro,代码行数:61,代码来源:gui.py

示例7: add_menus

# 需要导入模块: from tkinter import Menu [as 别名]
# 或者: from tkinter.Menu import add_separator [as 别名]
    def add_menus(self):
        menu_bar = Menu(self.root)
        stampede_menu = Menu(menu_bar, tearoff=0)
        stampede_menu.add_command(label="Settings", command=self.edit_default_settings)
        stampede_menu.add_separator()
        stampede_menu.add_command(label="Quit", command=self.root.quit)
        menu_bar.add_cascade(label="Stampede", menu=stampede_menu)

        self.root.config(menu=menu_bar)
开发者ID:qcaron,项目名称:stampede,代码行数:11,代码来源:main.py

示例8: modify_command

# 需要导入模块: from tkinter import Menu [as 别名]
# 或者: from tkinter.Menu import add_separator [as 别名]
	def modify_command(self, file_name):
		import tkinter as tk
		from tkinter import Menu
		from tkinter import messagebox
		import tkinter.scrolledtext as tkst
		import os.path
		if os.path.isfile(file_name):
			file = open(file_name, 'r')
			read_text = file.readlines()
			file_text = ''
			for line in read_text:
				file_text = file_text + line
			file.close()
		else:
			file_text = ''
		win = tk.Tk()
		win.title(file_name)
		frame1 = tk.Frame(
			master = win,
			bg = '#808000'
		)
		global editArea
		editArea = tkst.ScrolledText(
			master = frame1,
			wrap = tk.WORD,
			width = 20,
			height = 10
		)
		def save_command():
			global editArea
			file = open(file_name, 'w')
			data = editArea.get('1.0', 'end-1c')
			file.write(data)
			file.close()
		def not_save_exit_command():
			if messagebox.askokcancel("Quit", "(Not Save) Do you really want to quit?"):
				win.destroy()			
		def exit_command():
			global editArea
			file = open(file_name, 'w')
			data = editArea.get('1.0', 'end-1c')
			file.write(data)
			file.close()
			if messagebox.askokcancel("Quit", "Do you really want to quit?"):
				win.destroy()
		frame1.pack(fill='both', expand='yes')
		menu = Menu(win)
		win.config(menu=menu)
		filemenu = Menu(menu)
		menu.add_cascade(label='File', menu=filemenu)
		filemenu.add_command(label='Save', command=save_command)
		filemenu.add_command(label='Not Save and Exit', command=not_save_exit_command)
		filemenu.add_separator()
		filemenu.add_command(label='Save and Exit', command=exit_command)
		editArea.pack(padx=10, pady=10, fill=tk.BOTH, expand=True)
		editArea.insert(tk.INSERT, file_text)
		win.mainloop()
开发者ID:supotmaild,项目名称:FoxPy,代码行数:59,代码来源:fox.py

示例9: __init__

# 需要导入模块: from tkinter import Menu [as 别名]
# 或者: from tkinter.Menu import add_separator [as 别名]
    def __init__(self, root, config_save):
        self.root = root
        self.config_save = config_save

        # Create a menu
        root_menu = Menu(root)
        root.config(menu=root_menu)

        xnat_menu = Menu(root_menu)
        root_menu.add_cascade(label="GIFT-Cloud", menu=xnat_menu)

        xnat_menu.add_command(label="About", command=self.menu_about)
        xnat_menu.add_separator()
        xnat_menu.add_command(label="Settings", command=self.menu_settings)
        xnat_menu.add_separator()
        xnat_menu.add_command(label="Quit", command=self.menu_exit)
开发者ID:tomdoel,项目名称:pyxnatbrowser,代码行数:18,代码来源:mainframe.py

示例10: __init__

# 需要导入模块: from tkinter import Menu [as 别名]
# 或者: from tkinter.Menu import add_separator [as 别名]
    def __init__(self, parent):
        Frame.__init__(self, parent)   
         


        if not os.path.exists(self.WORK_FILE):
            os.makedirs(self.WORK_DIR)
            self.simulateReboot(True)




        self.parent = parent

        menu = Menu(self.parent)
        menu1 = Menu(menu,tearoff=0)
        menu1.add_command(label="Simulate Reboot",command=self.simulateReboot)
        menu1.add_separator()
        menu1.add_command(label="Quit!", command=self.parent.quit)
        menu.add_cascade(label="Menu",menu=menu1)

        # display the menu
        self.parent.config(menu=menu)

        self.parent.title("GPIOSim")        
        self.pack(fill=BOTH, expand=1)

        self.canvas = None
        self.canvas = Canvas(self, bg=self.BG_COLOR) 
        #self.canvas.bind("<Button-1>",self.click)


        #Images (gif base64 encoded)
        imgInLeft = "R0lGODlhHgASAOf7AAoMCAITBB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MIAAAAwQAAENGEAAAwUowMAF1ohTTjnphBsQADs="
        self.phInLeft = PhotoImage(data=bytes(imgInLeft, 'latin1'))
        self.phInRight = PhotoImage(data=bytes(imgInRight, 'latin1'))
        self.phOutLeft = PhotoImage(data=bytes(imgOutLeft, 'latin1'))
        self.phOutRight = PhotoImage(data=bytes(imgOutRight, 'latin1'))

        self.updateUI()
开发者ID:ekapujiw2002,项目名称:GPIOSim,代码行数:47,代码来源:GPIOSim.py

示例11: initUI

# 需要导入模块: from tkinter import Menu [as 别名]
# 或者: from tkinter.Menu import add_separator [as 别名]
    def initUI(self):
        self.parent.title("Submenu")

        menubar = Menu(self.parent)
        self.parent.config(menu=menubar)

        fileMenu = Menu(menubar)

        submenu = Menu(fileMenu)
        submenu.add_command(label="New Feed")
        submenu.add_command(label="Bookmarks")
        submenu.add_command(label="Mail")
        fileMenu.add_cascade(label="Import", menu=submenu, underline=0)

        fileMenu.add_separator()

        fileMenu.add_command(label="Exit", underline=0, command=self.onExit)
        menubar.add_cascade(label="File", underline=0, menu=fileMenu)
开发者ID:Exodus111,项目名称:Projects,代码行数:20,代码来源:submenu.py

示例12: Interface

# 需要导入模块: from tkinter import Menu [as 别名]
# 或者: from tkinter.Menu import add_separator [as 别名]
class Interface(object):
    window = None
    text_pad = None
    menu = None
    file_menu = None

    def initialise_window(self):
        self.window = tkinter.Tk()
        self.window.wm_title(TITLE)
        self.window.geometry(WINDOW_SIZE)

        # add typing area
        self.text_pad = scrolledtext.ScrolledText(self.window, width=WINDOW_WIDTH, height=WINDOW_HEIGHT)

        self.add_options()
        self.text_pad.pack()
        self.window.mainloop()

    def add_options(self):
        self.menu = Menu(self.window)
        self.window.config(menu=self.menu)

        self.file_menu = Menu(self.window)
        self.options_menu = Menu(self.window)
        self.about_menu = Menu(self.window)

        # file filter menu
        self.menu.add_cascade(label="File", menu=self.file_menu)
        self.file_menu.add_command(label="New", command=self.dummy_action)
        self.file_menu.add_command(label="Open", command=self.dummy_action)
        self.file_menu.add_command(label="Save", command=self.dummy_action)
        self.file_menu.add_command(label="Save As...", command=self.dummy_action)
        self.file_menu.add_separator()
        self.file_menu.add_command(label="Exit", command=self.dummy_action)

        # option menu
        self.menu.add_cascade(label="Options", menu=self.options_menu)

        # about menu
        self.menu.add_cascade(label="About", menu=self.about_menu)

    def dummy_action(self):
        print(self.__class__.__name__ + " invoked")
开发者ID:oflynned,项目名称:RealTimeGrammar,代码行数:45,代码来源:Interface.py

示例13: createMenu

# 需要导入模块: from tkinter import Menu [as 别名]
# 或者: from tkinter.Menu import add_separator [as 别名]
 def createMenu(self):
     menu = Menu(self)
     self.config(menu=menu)
     #File
     mnFile = Menu(menu, tearoff=0)
     menu.add_cascade(label=_("File"), underline=0, menu=mnFile)
     mnFile.add_command(label=_("New..."), underline=0, command=lambda cmd='NEW':  self.onCommand(cmd))
     mnFile.add_command(label=_("Open..."), underline=0, command=lambda cmd='OPEN': self.onCommand(cmd))
     mnFile.add_separator()
     mnFile.add_command(label=_("Quit"), underline=0, command=lambda cmd='EXIT': self.onCommand(cmd))
     #View
     self.mnView = Menu(menu, tearoff=0)
     menu.add_cascade(label=_("View"), underline=0, menu=self.mnView)
     self.mnView.add_command(label=_("Tables at %s") % _('right'), underline=0, command=lambda cmd='TABLES_RL': self.onCommand(cmd))
     #Help
     mnHelp = Menu(menu, tearoff=0)
     menu.add_cascade(label=_("Help"), underline=0, menu=mnHelp)
     mnHelp.add_command(label=_("SQL by SQLite..."), underline=0, command=lambda: webbrowser.open(self.sqlSqliteUrl))
     mnHelp.add_command(label=_("About..."), underline=0, command=lambda cmd='ABOUT': self.onCommand(cmd))
开发者ID:mncarbone,项目名称:mundiales,代码行数:21,代码来源:dbeditor.py

示例14: TopMenuBar

# 需要导入模块: from tkinter import Menu [as 别名]
# 或者: from tkinter.Menu import add_separator [as 别名]
class TopMenuBar(Menu):
    def __init__(self, parent):
        Menu.__init__(self, parent)
        self.parent = parent
        self.newmenu = Menu(self)
        self.showmenu = Menu(self)
        self.added_buttons = []
        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.showmenu.add_command(label="Save Image", command=self.parent.save_image)
        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)

    def add_button(self, menu, name, call):
        func = partial(call, name)
        if menu == "new":
            self.newmenu.add_command(label=name, command=func)
        elif menu == "show":
            self.showmenu.add_command(label=name, command=func)
        self.added_buttons.append(name)

    def remove_all(self):
        for but in self.added_buttons:
            self.remove_item(name)

    def remove_item(self, name):
        self.showmenu.delete(name)
开发者ID:Exodus111,项目名称:Projects,代码行数:35,代码来源:gui_items.py

示例15: __init__

# 需要导入模块: from tkinter import Menu [as 别名]
# 或者: from tkinter.Menu import add_separator [as 别名]
	def __init__(self, parent=None):
		Frame.__init__(self,parent)
		self.parent = parent
		self.parent.title("Accounting")
		
		self.status = StatusBar(parent)
		self.status.set("%s","...")
		self.status.pack(side=BOTTOM, fill=BOTH)
		
		self.leftmenu = LeftMenu(parent)
		self.leftmenu.pack(side=LEFT, fill=BOTH)
			
		self.paymentframe = Frame(self,relief=GROOVE, bd=1)
		Label(self.paymentframe,text="Упорядочить по",height=2).grid(row=0,column=0,columnspan=2)
		self.paymentframe.pack(side=TOP,fill=BOTH,expand=YES)

		
		self.menubar = Menu(self)
		menu = Menu(self.menubar, tearoff=0)
		self.menubar.add_cascade(label="File", menu=menu)
		menu.add_command(label="LogIn", command=(lambda: authWindow(self)))
		menu.add_separator()
		menu.add_command(label="MessBox",command=(lambda: self.addPayment()))
		menu.add_separator()
		menu.add_command(label="Close", command=self.quit)

		menu = Menu(self.menubar, tearoff=0)
		self.menubar.add_cascade(label="Other", menu=menu)
		menu.add_command(label="Статистика", command=(lambda: Statistics(self)))
		menu.add_command(label="Copy")
		menu.add_command(label="Paste")
		
		try:
			self.master.config(menu=self.menubar)
		except AttributeError:
		    # master is a toplevel window (Python 1.4/Tkinter 1.63)
		    self.master.tk.call(master, "config", "-menu", self.menubar)		
		
		
		self.pack()
开发者ID:xenon4er,项目名称:trytkinter,代码行数:42,代码来源:tk.py


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