what wrong with this program?
Robert Kern
rkern at ucsd.edu
Tue Aug 17 21:47:15 EDT 2004
Ali wrote:
> The following program is supposed to display a dropdown menu, however,
> it only shows the File and Help things.
>
> from Tkinter import *
>
> root = Tk()
>
> #create menu
> m = Menu(root)
> root.config(menu=m)
>
> filemenu = Menu(m)
> m.add_cascade(label="File", menu="filemenu")
The menu= argument needs to be the object itself, not a string.
See, e.g.
http://www.pythonware.com/library/tkinter/introduction/x5819-patterns.htm
--
Robert Kern
rkern at ucsd.edu
"In the fields of hell where the grass grows high
Are the graves of dreams allowed to die."
-- Richard Harter
More information about the Python-list
mailing list