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 2 Years Ago by CodingCabbage: extra information

Maybe this will help ...

# a Tkinter menu example similar to:
# http://effbot.org/tkinterbook/tkinter-application-windows.htm

    # Python2
    import Tkinter as tk
except ImportError:
    # Python3
    import tkinter as tk

def outer(val):
    """using a closure to pass args"""
    def inner():
    return inner

root = tk.Tk()

# create a menu
menu = tk.Menu(root)

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_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"))


I managed to fix it
this was the end code

menubar = Menu(self.mainGUI)
fileMenu = Menu(menubar)
fileMenu.add_command(label="Exit", command= self.destroyMethod)
menubar.add_cascade(label="File", menu=fileMenu)
This question has already been answered. Start a new discussion instead.