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)
For the past several years I have been feeling quite embarrassed about my coding abilities. I've been self studying most nights trying to catch up to my peers but I ...
Guys, Ive gotten it into my head to do somthing fairly difficult for me,
I want to communicate with a swing application, to a proximetly sensor, and track live when ...
hello there. i needed a little help in writing coding for reading multiple lines of data from a .txt file that are seperated by commas.
Student Name, Student ID, Mark ...