[Pythonmac-SIG] Tkinter and the Help menu
John Speno
macpython@lopan.dccs.upenn.edu
Fri, 28 Feb 2003 13:24:39 -0500
Platform: MacOS X 10.2.4, Python 2.3a2, Tcl and Tk 8.4.1 jaguar.
Issue: In my application's Help menu, the first item is an extraneous 'x'
which I didn't put there, and can't seem to get rid of. Actually, when I
first switch to the application, each item in my Help menu is an 'x'. If I
switch to another app then back, my menu items have their names back, and
there's still the first mysterious 'x'.
Anyone encounter that before? I suppose I can try the TOT build of
Tcl/Tk...
Thanks!
#!/usr/local/bin/pythonw
import Tkinter
def hello():
print "hello"
root = Tkinter.Tk()
root.title('menubar test')
menubar = Tkinter.Menu(root)
helpmenu = Tkinter.Menu(menubar, name='help', tearoff=0)
menubar.add_cascade(label="Help", menu=helpmenu, underline=0)
addhelp = helpmenu.add_command
addhelp(label='Window Help', underline=0, command=hello, state='normal')
addhelp(label='Menu Help', underline=9, command=hello, state='normal')
helpmenu.add_separator()
addhelp(label='About Assignments', underline=0, command=hello)
root.configure(menu=menubar)
root.mainloop()