I am going through the Tk/Tkinter tutorial and
when I try to run the menubar program I get two windows instead of a menubar on one window.
Here is the code:
from tkinter import *
from tkinter import ttk
root = Tk()
root.option_add('*tearOff', FALSE)
win = Toplevel(root)
menubar = Menu(win)
win['menu'] = menubar
menubar = Menu(win)
menu_file = Menu(menubar)
menu_edit = Menu(menubar)
menubar.add_cascade(menu=menu_file, label='File')
menubar.add_cascade(menu=menu_edit, label='Edit')
menu_file.add_command(label='New', command=None)
menu_file.add_command(label='Open...', command=None)
menu_file.add_command(label='Close', command=None)
root.mainloop()
Please let me know what I am doing wrong.
- WolfShield