[GRASS-dev] Modules

Glynn Clements glynn at gclements.plus.com
Fri Feb 23 00:42:52 EST 2007


Michael Barton wrote:

> I had one error that seemed to happen when I first tried to set the
> background during a digitizing session. However, I have not been able to
> reproduce it. I'll copy it below in case there is a gotcha still lurking
> somewhere. If it happens again and I can figure out what triggers it, I'll
> let you know.
> 
> Michael
> 
> --- mysterious one-time error ----
> 
> can't read "bind_scroll_list": no such variable
> can't read "bind_scroll_list": no such variable
>     while executing
> "foreach window $bind_scroll_list {
>         if {![winfo exists $window]} {
>             set window_gone 1
>             continue
>         } 
>         if {![..."
>     (procedure "handle_scroll" line 8)
>     invoked from within
> "handle_scroll 120"
>     (command bound to event)

After failing to find either of the strings bind_scroll_list or
handle_scroll in any of vector/v.digit/*, lib/external/bwidget/* or
even /usr/lib/tk8.4/*, I was starting to wonder about your sanity. 
Then I found it in lib/gtcltk/select.tcl.

That file contains the following at the top level:

	bind all <MouseWheel> "handle_scroll %D"
	bind all <Button-4> "handle_scroll 120"
	bind all <Button-5> "handle_scroll -120"

The global variable bind_scroll_list gets defined in bind_scroll which
is called by GSelect_::create, which is called by GSelect, which is
called by zoom_region (the zoom-to-saved-region tool) in v.digit.

Unless and until you use that tool, moving the mouse wheel over the
v.digit window (toolbar) will cause this error. Note that this issue
isn't related to my recent changes; the same error occurs in previous
versions of v.digit.

It's debatable whether select.tcl should be using "bind all ...",
rather than adding the bindings to specific windows.

Probably the simplest fix is to add:

	set bind_scroll_list {}

at the top level of select.tcl.

Is Cedric still around? AFAICT, he wrote this code originally.

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




More information about the grass-dev mailing list