Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #75769

Re: Tkinter menu crash

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed3a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <python-python-list@m.gmane.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.000
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'python.': 0.02; 'root': 0.05; 'subject:menu': 0.05; 'great.': 0.07; 'happens.': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'tcl/tk': 0.09; 'python': 0.11; 'jan': 0.12; 'attribute,': 0.16; 'displayed.': 0.16; 'empty,': 0.16; 'exactly?': 0.16; 'menu.': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'reedy': 0.16; 'subject:Tkinter': 0.16; 'fix': 0.17; 'wrote:': 0.18; 'looked': 0.18; 'entered': 0.20; 'header:User-Agent:1': 0.23; 'error': 0.23; 'entries': 0.24; 'necessary.': 0.24; 'sends': 0.24; 'text,': 0.24; 'earlier': 0.24; 'fairly': 0.24; 'header:X -Complaints-To:1': 0.27; 'header:In-Reply-To:1': 0.27; 'fixed': 0.29; 'label': 0.30; 'code': 0.31; 'apparently': 0.31; 'clicked': 0.31; 'run': 0.32; 'quite': 0.32; 'text': 0.33; 'third': 0.33; 'could': 0.34; 'problem.': 0.35; 'but': 0.35; 'add': 0.35; 'version': 0.36; 'leads': 0.36; 'done': 0.36; 'entry': 0.36; 'wrong': 0.37; 'problems': 0.38; 'displays': 0.38; 'to:addr :python-list': 0.38; 'pm,': 0.38; 'does': 0.39; 'received:71': 0.39; 'sure': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'how': 0.40; 'most': 0.60; 'new': 0.61; 'box,': 0.64; 'received:fios.verizon.net': 0.84
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From Terry Reedy <tjreedy@udel.edu>
Subject Re: Tkinter menu crash
Date Tue, 05 Aug 2014 19:27:33 -0400
References <1a31faea-eea6-4b1d-8dc1-185f13348621@googlegroups.com> <mailman.12677.1407275016.18130.python-list@python.org> <c2e3b6d8-da9a-447d-b67e-01877159412d@googlegroups.com>
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding 7bit
X-Gmane-NNTP-Posting-Host pool-71-175-90-87.phlapa.fios.verizon.net
User-Agent Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0
In-Reply-To <c2e3b6d8-da9a-447d-b67e-01877159412d@googlegroups.com>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.12681.1407281280.18130.python-list@python.org> (permalink)
Lines 33
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1407281280 news.xs4all.nl 2922 [2001:888:2000:d::a6]:58643
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:75769

Show key headers only | View raw


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 | NextPrevious in thread | Next in thread | Find similar | Unroll thread


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