[GRASS-dev] TclTk animator finished - replaces xganim

Glynn Clements glynn at gclements.plus.com
Sat Sep 15 15:51:57 EDT 2007


Michael Barton wrote:

> > [minor issue, I assume this is a tcl limitation]
> > I notice I can use ctrl-click to pick a number of maps at once, but only
> > left-click to reset and start from scratch. ie no way to unselect a map
> > without full reset. and shift-click to flood- select a bunch of maps
> > doesn't work.
> 
> This is part of the mysteries of select.tcl, an ancient but useful TclTk
> module that is one of the few remaining pieces inherited from tcltkgrass. I
> found the select multiple option buried in it and turned it on, but haven't
> tested it extensively. So I'm not sure how it really works.

The list is based on a BWidget Tree control. The "selection" command
supports the operations: set, add, remove, clear, get. select.tcl
effectively maps <ButtonPress-1> to "set" and <Control-ButtonPress-1>
to "add".

Changing the <Control-ButtonPress-1> behaviour to toggle shouldn't be
particularly hard to implement, e.g. (untested):

    if {[lsearch -exact [$tree selection get] $node] >= 0} {
        $tree selection remove $node
    } else {
        $tree selection add $node
    }

Supporting "extension" (typical Shift-click behaviour) would be more
work, requiring keeping track of the most recent selection and
manually enumerating the nodes in between.

-- 
Glynn Clements <glynn at gclements.plus.com>




More information about the grass-dev mailing list