Tk Library Source Code

View Ticket
Login
Ticket UUID: 1224203
Title: Tree widget substitutes wrong path for %W in command binding
Type: Bug Version: None
Submitter: jaspert Created on: 2005-06-20 14:50:22
Subsystem: bwidget Assigned To: damonc
Priority: 5 Medium Severity:
Status: Closed Last Modified: 2009-06-30 20:27:06
Resolution: Rejected Closed By: oehhar
    Closed on: 2009-06-30 13:27:06
Description:
If you put %W in the command bound to an action on a
Tree widget you expect to get the path of the tree
widget in its place when the command is invoked. But
instead you get a canvas called c which is a child of
the tree widget, as in this simple example...

[jaspert@nacho Simile]$ wish
% package require BWidget
1.7
% pack [Tree .t]
% .t insert end root foo -text FOO
foo
% proc putall {args} {puts $args}
% .t bindText <Button-1> "putall %W"
% # now click on the text FOO...
% .t.c foo
.t.c foo
.t.c foo
User Comments: oehhar added on 2009-06-30 20:27:05:
This is by design. An access to the label window path is not prevued.
Instead use the returned node id and the provided functions to manipulate the node.

I removed the remarks in the docs about that.
IMHO this should not work. We are on a higher level here.

Technically, canvas items have no window paths and thus could not be returned.

Please reply in case of other opinions.

dev_null42a added on 2006-09-28 22:47:35:
Logged In: YES 
user_id=1381097

I'm not sure how to fix the problem.  In the mean time, I
added a note to the man page that %W does not work.