Version 5 of BWidget::Tree

Updated 2006-01-23 13:02:06 by TR

Manual page:

Examples on use of BWidget::Tree:


TR - The Tree has no default binding for the selection of ranges. This is usually done by selectiong a node and then selecting another while pressing down the Shift key. This proc will do the work:

 proc TreeSelectRange {tree node} {
        #
        # add a continuous range of nodes to an existing selection
        #
        # tree -> path to the BWidget tree
        # node -> the node that has been clicked on
        #

        # remember current selection:
        set sel [$tree selection get]
        # get last selected node:
        set last [lindex $sel end]
        # select the requested range:
        $tree selection range $last $node
        # add the remembered nodes:
        foreach node $sel {$tree selection add $node}
 }

Then you just need something like

 $tree bindText <Shift-Button-1> [list TreeSelectRange %W]

to make the binding work.


Category Widget, part of the Bwidget extension.