classification
Title: Make Tkinter.py's nametowidget work with cloned menu widgets
Type: enhancement Stage: patch review
Components: Tkinter Versions: Python 3.2
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: BreamoreBoy, belopolsky, gpolo, gregcouch, jepler
Priority: normal Keywords: patch

Created on 2003-05-07 20:11 by gregcouch, last changed 2010-08-18 16:21 by belopolsky.

Files
File name Uploaded Description Edit
Tkinter.py.diffs gregcouch, 2003-05-07 20:11 nametowidget patch for cloned widgets
nametowidget_clonedmenus.diff gpolo, 2008-12-31 17:04 review
Messages (5)
msg43671 - (view) Author: Greg Couch (gregcouch) Date: 2003-05-07 20:11
Tk will clone menu widgets when they are torn off and
it gives them names at are similar to the original
widget's names.  The patch extends the nametowidget so
it will return the original widget when given the name
of a cloned widget.  We used this patch to provide
balloon help in cloned menus.  This patch isn't
perfect, it will fail on clones of clones, but it is a
big help.

This patch was made against the latest CVS version
1.173 of Tkinter.py but works against older
Tkinter.py's too.

     - Greg Couch
msg43672 - (view) Author: Jeff Epler (jepler) Date: 2003-05-11 14:30
Logged In: YES 
user_id=2772

I don't believe that the naming convention of cloned menus is actually documented anywhere (it's certainly not documented in menu(n) of tk-8.3.5 as packaged by RedHat.  The only promise that the documentation makes is that the clone "is a child of the original". (but that can be violated if "menu clone" is invoked directly:

% menu .m
.m
% .m clone .n
%
)

That said, the convention for automatically generated clones hasn't varied in the versions of Tk I'm aware of (at least 8.2 through 8.4) so it might be reasonable to depend on this.

Does anybody in Python development also keep up with Tcl/Tk development?  It might be reasonable to ask them to document the format of automatically generated clone names.
msg78634 - (view) Author: Guilherme Polo (gpolo) * (Python committer) Date: 2008-12-31 17:04
Eh.. old.
Anyway, I have made a patch against trunk now and it should work with
any nested level of cloned menus according to how tk names cloned menus.
msg114239 - (view) Author: Mark Lawrence (BreamoreBoy) Date: 2010-08-18 16:11
A small simple patch that I see no problems with.
msg114244 - (view) Author: Alexander Belopolsky (belopolsky) (Python committer) Date: 2010-08-18 16:21
Can someone post a script demonstrating the proposed feature?  Is "clones of clones" issue mentioned by OP resolved in the latest patch?

Given that nobody commented on this issue for 7 years, I am skeptical about the utility of this feature.
History
Date User Action Args
2010-08-18 16:21:40belopolskysetnosy: + belopolsky
messages: + msg114244
2010-08-18 16:11:13BreamoreBoysetversions: + Python 3.2, - Python 2.6, Python 3.0, Python 3.1, Python 2.7
nosy: + BreamoreBoy

messages: + msg114239

type: enhancement
stage: patch review
2008-12-31 17:04:34gpolosetfiles: + nametowidget_clonedmenus.diff
nosy: + gpolo
messages: + msg78634
versions: + Python 2.6, Python 3.0, Python 3.1, Python 2.7, - Python 2.3
2003-05-07 20:11:52gregcouchcreate