[GRASS-dev] new profiling tool and other gis.m updates

Trevor Wiens twiens at interbaun.com
Mon May 22 15:53:28 EDT 2006


On Mon, 22 May 2006 09:34:12 +0100
Glynn Clements <glynn at gclements.plus.com> wrote:
> The simplest approach would be to have a file which stores the event
> sequences in an array, then have any bind commands use that, e.g.:
> 
> bindings.tcl:
> 
> 	set bindings(mapcan_redraw) <KeyPress-c>
> 	set bindings(mapcan_zoom) <KeyPress-space>
> 
> 	...
> 
> 	# allow user to override bindings
> 	source $env(HOME)/.gis.m/bindings.tcl
> 
> Other Tcl files:
> 
> 	source $gmpath/bindings.tcl
> 
> 	...
> 
> 	global bindings
> 
> 	bind .mapcan($mon) $bindings(mapcan_redraw) {...}
> 	bind .mapcan($mon) $bindings(mapcan_zoom) {...}
> 
> This should be done for key and mouse events, but not "system" events
> such as Configure, Destroy, FocusIn, etc.
> 
> Note that Tk allows some abbreviations. E.g. Key/KeyPress can be
> omitted if the keysym is given, so <KeyPress-Escape> can be
> abbreviated to <Escape>. Button/ButtonPress can be omitted if the
> button number is given, so <ButtonPress-1> can be abbreviated to <1>.
> 
> For clarity, I would suggest avoiding the use of these abbreviations
> in the code, using the most explicit form instead.
> 
Thanks Glynn,

I'll get working on that this week.

T
-- 
Trevor Wiens 
twiens at interbaun.com

The significant problems that we face cannot be solved at the same 
level of thinking we were at when we created them. 
(Albert Einstein)




More information about the grass-dev mailing list