Serhiy Storchaka added the comment:

> The 'virtue' of the digit strings names is that they match tk behavior (I 
> presume) and are consistently opaque ;-)

No, in Tk you have to give names for all widgets.

frame .main
button .main.ok

This is similar to how classes or functions are declared in Python. The name 
becomes an attribute of an object and a reference to an object. You shouldn't 
repeat it twice.

Here is a patch that implements nicer generated widget names.

The problem with ".frame1.button2" or ".frame-1.button-2" is that they look too 
human readable. If you use explicit names for the part of widgets and allow 
generating names for other part, there is large chance that generated "button2" 
or "button-2" will conflict with explicit names. I think we should use 
something that makes generated names uglier. Maybe prefix them with "_"? 
"._frame1._button2".

----------
keywords: +patch
stage:  -> patch review
Added file: http://bugs.python.org/file42867/tkinter_names.patch

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue27025>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to