Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #25170
| Subject | Re: Tkinter.event.widget: handler gets name instead of widget. |
|---|---|
| From | Frederic Rentsch <anthra.norell@bluewin.ch> |
| References | (1 earlier) <mailman.1933.1341813557.4697.python-list@python.org> <e903a18d-a348-4ba3-8b0c-2b51bca7dbd6@l32g2000yqc.googlegroups.com> <mailman.1984.1341914689.4697.python-list@python.org> <89816e26-fc20-4cdc-ba6c-f252231d43ba@f16g2000yqg.googlegroups.com> <25935b3c-b37d-465f-9855-7ecf2c3bdf4e@h10g2000yqn.googlegroups.com> |
| Date | 2012-07-11 09:59 +0200 |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.2010.1341993643.4697.python-list@python.org> (permalink) |
On Tue, 2012-07-10 at 18:06 -0700, Rick Johnson wrote:
> Also:
>
> Q3: Why are you explicitly setting the name of your "subFrame" widgets
> instead of allowing Tkinter to assign a unique name?...AND are you
> aware of the conflicts that can arise from such changes[1]?
>
I find custom-named widgets easier to work with during development. I can tell
what this is; ".main-frame.data-frame.title-hit-list.-10-". If I didn't assign
names it would look something line this:".2837029.283725.283762.2848308".
Once my program works I can drop custom-naming.
I understand that conflicts may arise if one assigns numeric names.
To find out whether the digits in the label names ('-10-' above) might
be implicated, I changed to spelled-out names ('ten'). The change had no
effect. The reference you list blow (x147-more-on-widget-names.htm)
indeed says "don't use names which only contain digits".
> Q4: Are you aware of the built-in function "enumerate"[2]? I see you
> are passing around indexes to iterables AND simultaneously needing the
> obj reference itself. I prefer to keep indexing to a minimum. If
> there is no bleeding edge performance issue to worry about (and there
> almost *always* never is) why not use enumerate?
>
Aware, yes. In the habit of, no. Thanks for the reminder.
> [1] http://www.pythonware.com/library/tkinter/introduction/x147-more-on-widget-names.htm
> [2] http://docs.python.org/release/3.0.1/library/functions.html#enumerate
Frederic
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Re: Tkinter.event.widget: handler gets name instead of widget. Terry Reedy <tjreedy@udel.edu> - 2012-07-09 01:58 -0400
Re: Tkinter.event.widget: handler gets name instead of widget. Rick Johnson <rantingrickjohnson@gmail.com> - 2012-07-09 10:49 -0700
Re: Tkinter.event.widget: handler gets name instead of widget. Terry Reedy <tjreedy@udel.edu> - 2012-07-09 15:45 -0400
Re: Tkinter.event.widget: handler gets name instead of widget. Frederic Rentsch <anthra.norell@bluewin.ch> - 2012-07-09 22:47 +0200
Re: Tkinter.event.widget: handler gets name instead of widget. Chris Angelico <rosuav@gmail.com> - 2012-07-10 08:23 +1000
Re: Tkinter.event.widget: handler gets name instead of widget. Frederic Rentsch <anthra.norell@bluewin.ch> - 2012-07-10 12:03 +0200
Re: Tkinter.event.widget: handler gets name instead of widget. Rick Johnson <rantingrickjohnson@gmail.com> - 2012-07-10 15:11 -0700
Re: Tkinter.event.widget: handler gets name instead of widget. Rick Johnson <rantingrickjohnson@gmail.com> - 2012-07-10 18:06 -0700
Re: Tkinter.event.widget: handler gets name instead of widget. Frederic Rentsch <anthra.norell@bluewin.ch> - 2012-07-11 09:59 +0200
Re: Tkinter.event.widget: handler gets name instead of widget. Frederic Rentsch <anthra.norell@bluewin.ch> - 2012-07-12 20:53 +0200
Re: Tkinter.event.widget: handler gets name instead of widget. rantingrickjohnson@gmail.com - 2012-07-14 20:10 -0700
Re: Tkinter.event.widget: handler gets name instead of widget. Frederic Rentsch <anthra.norell@bluewin.ch> - 2012-07-16 12:32 +0200
Re: Tkinter.event.widget: handler gets name instead of widget. rantingrickjohnson@gmail.com - 2012-07-14 20:10 -0700
Re: Tkinter.event.widget: handler gets name instead of widget. Peter Otten <__peter__@web.de> - 2012-07-13 09:26 +0200
Re: Tkinter.event.widget: handler gets name instead of widget. Frederic Rentsch <anthra.norell@bluewin.ch> - 2012-07-13 22:24 +0200
Re: Tkinter.event.widget: handler gets name instead of widget. Terry Reedy <tjreedy@udel.edu> - 2012-07-13 19:23 -0400
Re: Tkinter.event.widget: handler gets name instead of widget. Peter Otten <__peter__@web.de> - 2012-07-14 09:47 +0200
csiph-web