I have these few lines in a class in my program but it doesnt appear. No errors are shown and when i "print(menubar)" and address "0.4.." or "4..." appears
menubar = Menu(master = self.mainGUI) fileMenu = Menu(menubar) fileMenu.add_command(label="Exit", command= destroyMethod) menubar.add_cascade(label="File", menu=fileMenu)
destroy method does work and is existing.
Edited by CodingCabbage: extra information
Maybe this will help ...
# a Tkinter menu example similar to: # http://effbot.org/tkinterbook/tkinter-application-windows.htm try: # Python2 import Tkinter as tk except ImportError: # Python3 import tkinter as tk def outer(val): """using a closure to pass args""" def inner(): root.title(val) return inner root = tk.Tk() # create a menu menu = tk.Menu(root) root.config(menu=menu) filemenu = tk.Menu(menu) menu.add_cascade(label="File", menu=filemenu) filemenu.add_command(label="New", command=outer("New")) filemenu.add_command(label="Open", command=outer("Open")) filemenu.add_separator() filemenu.add_command(label="Exit", command=outer("Exit")) helpmenu = tk.Menu(menu) menu.add_cascade(label="Help", menu=helpmenu) helpmenu.add_command(label="About", command=outer("About")) root.mainloop()
I managed to fix it
this was the end code
menubar = Menu(self.mainGUI) self.mainGUI.config(menu=menubar) fileMenu = Menu(menubar) fileMenu.add_command(label="Exit", command= self.destroyMethod) menubar.add_cascade(label="File", menu=fileMenu)
Good man James helped me learn die roll board game programming in Java,
and I applied it on Ladders and Snakes. Made one in Java. Now I'm learning to do ...
I have a problem to get unique values from dateperiod-loop.
There is a tons of examples how to do it, but after hours of searching, i couldn't find suitable ...
Hello everyone hope you are doing well, i was busy these days i was having problem with the police in my country, they catch me smoking weed and now i ...