Problems with Tkinter and menus

Fredrik Juhlin laz at strakt.com
Thu Dec 13 06:21:15 EST 2001


On Thu, Dec 13, 2001 at 11:31:06AM +0100, Eric Brunel wrote:
> Apparently, the code like you wrote it actually works on Windows, but I
> remember that I had a similar problem on Linux, and it was caused by a
> problem in the menu hierarchy: have you tried to create menu0 before menu1
> and create menu1 as a son of menu0, like in:
> menu0 = Tkinter.Menu(root, tearoff=0)
> menu1 = Tkinter.Menu(menu0, tearoff=0)
> menu1.add_command(label="Foo", command=hello)
> # ...
> Just try it: it may solve your problem. And doing it this way still works on
> Windows.
This worked fine! And like so many other thing, painfully obvious once
someone points it out :)

Thanks a lot!

//FJ




More information about the Python-list mailing list