what is wrong with this program?

Ali alikakakhel3 at hotmail.com
Tue Aug 17 20:23:28 EDT 2004


The following program is supposed to show a menu but it isnt showing
the drop down menus. It only shows the File and Help thing.

from Tkinter import *

def callback:
    print "Alhumdulillah

root = Tk()

#create menu

m = Menu(root)
root.config(menu=m)

filemenu = add_cascade(label="File", menu="filemenu")
filemenu.add_command(label="New", command=callback)
filemenu.add_separator()
filemenu.add_command(label="Quit", command=callback)

helpmenu = Menu(m)
m.add_cascade(label="Help", menu="helpmenu")
helpmenu.add_command(label="About", command=callback)

root.mainloop()

please help me fix it



More information about the Python-list mailing list