"Ali" <al**********@hotmail.com> wrote in message
news:8f**************************@posting.google.c om...
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
Here is a working version, just compare to above should be quite
self explanitory, more help can be found on
www.pythonware.com
---
from Tkinter import *
def callback():
print "Alhumdulillah"
root = Tk()
#create menu
m = Menu(root)
filemenu = Menu(m)
filemenu.add_command(label="New", command=callback)
filemenu.add_separator()
filemenu.add_command(label="Quit", command=callback)
m.add_cascade(label="File", menu=filemenu)
helpmenu = Menu(m)
helpmenu.add_command(label="About", command=callback)
m.add_cascade(label="Help", menu=helpmenu)
root.config(menu=m)
root.mainloop()
---
Hope this helps.
Adonis