Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #75769
| From | Terry Reedy <tjreedy@udel.edu> |
|---|---|
| Subject | Re: Tkinter menu crash |
| Date | 2014-08-05 19:27 -0400 |
| References | <1a31faea-eea6-4b1d-8dc1-185f13348621@googlegroups.com> <mailman.12677.1407275016.18130.python-list@python.org> <c2e3b6d8-da9a-447d-b67e-01877159412d@googlegroups.com> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.12681.1407281280.18130.python-list@python.org> (permalink) |
On 8/5/2014 6:28 PM, Nicholas Cannon wrote: > Ok so I am on 2.7.8. >> What x.y.z version of Python. How did you run it, exactly? > >> Adding filemenu as a submenu of filemenu leads to infinite loop regress. >> >> On 3.4.1 with tcl/tk 8.6, this does not crash, but it might on an >> >> earlier version of Python and tcl/tk. >> Since menubar is left empty, it is not displayed. Fix both problems with >> >> menubar.add_cascade(label='TK UI Sample', menu=filemenu) >> >> root.config(menu=menubar) > Yeah this fixed the problem. So the main menu object needs to be cascade instead of the filemenu. Will this need to be done every I create a new menu? I am not sure what you mean here. The main menu bar menubar is not a cascade. Added to root as the menu attribute, it displays horizonatally. You add filemenu to menebar as a cascade. It then displays vertically under its label on the main menu. It is fairly conventional that all the entries on the main menu are cascades, but apparently not necessary. It is also fairly conventional that most items on drop down menus are not cascades, but you could add a third menu to filemenu as a cascade. >> and ran -- no crash, no error message, no menu. I entered text into box, >> clicked Submit text, and OK on popup, and nothing happens. > Im not quite sure what is happening here. Oh I just looked at the code and the part that sends the entry box text is in the wrong place or must have been unindented I have fixed this now and it works great. > -- Terry Jan Reedy
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Tkinter menu crash Nicholas Cannon <nicholascannon1@gmail.com> - 2014-08-05 05:15 -0700
Re: Tkinter menu crash Terry Reedy <tjreedy@udel.edu> - 2014-08-05 17:43 -0400
Re: Tkinter menu crash Nicholas Cannon <nicholascannon1@gmail.com> - 2014-08-05 15:28 -0700
Re: Tkinter menu crash Terry Reedy <tjreedy@udel.edu> - 2014-08-05 19:27 -0400
Re: Tkinter menu crash Nicholas Cannon <nicholascannon1@gmail.com> - 2014-08-05 16:33 -0700
Re: Tkinter menu crash Terry Reedy <tjreedy@udel.edu> - 2014-08-06 00:13 -0400
csiph-web