Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

2 Questions on Tree widget

5 views
Skip to first unread message

Cassy

unread,
Sep 2, 2005, 5:52:18 PM9/2/05
to
Dear all,

1. How may I know if at any instant of time, a tree node is opened or
closed. If I should do an itemcget on a nodes -open option or is it
-autocross option, please let me know ? If both are possible, which is
better and safer ?

2. And how do the xview and the yview commands associated with the Tree
work ?

The documentation for these says only so much :
pathName xview ?arg...?
Standard command to enable horizontal scrolling of pathName.

pathName yview ?arg...?
Standard command to enable vertical scrolling of pathName.

What are the args here ??? Please explain ...


Thanks.

Cassy

unread,
Sep 3, 2005, 11:52:25 AM9/3/05
to
Please can somebody answer my question.

Thanks.

suchenwi

unread,
Sep 3, 2005, 3:57:46 PM9/3/05
to
The idea is rather that when the user opens or closes a node, an
-opencommand or -closecommand is invoked and calls your code back to do
what's needed.

The x/yview methods just service the standard scrollbar protocol.
Consider this snippet from http://mini.net/tcl/LemonTree :

Tree .t -background white -opencmd {LemonTree::open .t}
-yscrollcommand {.y set}
pack [scrollbar .y -command {.t yview}] -side right -fill y

The additional arguments are automagically added when the scrollbar is
moved.

0 new messages