[Python-bugs-list] [ python-Bugs-492386 ] Cascading menu bug on Linux
noreply@sourceforge.net
noreply@sourceforge.net
Fri, 14 Dec 2001 21:30:01 -0800
Bugs item #492386, was opened at 2001-12-12 23:57
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=492386&group_id=5470
Category: Tkinter
Group: Platform-specific
>Status: Closed
>Resolution: Invalid
Priority: 5
Submitted By: Fredrik Juhlin (faeltir)
Assigned to: Nobody/Anonymous (nobody)
Summary: Cascading menu bug on Linux
Initial Comment:
When using post() to display a cascading menu,it
appears as if submenus don't get mouse events under
Linux/X. I've submitted some test code below to
demonstrate the problem.
I'm using Linux 2.4.5/XFree86 4.1.0/Python 2.1/Tcl
8.3. I've been told that the same code works fine on
Win2000.
# Code to show problem with cascading menus
import Tkinter
def hello():
print "hello!"
root = Tkinter.Tk()
frame = Tkinter.Frame(root, width=200, height=200)
frame.pack()
menu1 = Tkinter.Menu(frame, tearoff=0)
menu1.add_command(label="Foo", command=hello)
menu1.add_command(label="Bar", command=hello)
menu0 = Tkinter.Menu(frame, tearoff=0)
menu0.add_command(label="Command 1", command=hello)
#This works
menu0.add_cascade(label="Menu 1", menu=menu1)
#Commands used in this menu
#won't
work
def showMenu(event):
menu0.post(event.x_root, event.y_root)
frame.bind("<Button-3>", showMenu)
Tkinter.mainloop()
----------------------------------------------------------------------
Comment By: Fredrik Juhlin (faeltir)
Date: 2001-12-13 07:20
Message:
Logged In: YES
user_id=386805
My bad. I wasn't using the first-level menu as master for
the second-level menu.I'm not sure how to set status for
the bug-report properly, so I'll let some admin-type do
that.
----------------------------------------------------------------------
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=492386&group_id=5470