Re: unbind?

From: Grant Edwards <grante_at_rosevax.rosemount.com>
Date: Fri, 30 Sep 1994 10:58:50 -0500 (CDT)

Erick writes:

> To remove a binding, you have to pass a null string as binding. For
> instance:

> (bind .b "<2>" '(format #t "Button 2 pressed\n")))
> ....
> (define old-binding (bind .b "<2>"))
> (bind .b "<2>" "") ;; kill the binding
> ....
> (bind .b "<2>" old-binding) ;; restore it

Don't forget that giving bind an empy string removes the previous
binding for that widget and it will default back to the class binding.

If you wan't to make sure _nothing_ happens when the specified event
occurs you have to pass a non-empty-string that does nothing:

 (bind .b "<2>" '(format #t "hi!\n")) ;; show event happened
 (bind .b "<2>" "") ;; use class binding
 (bind .b "<2>" "()") ;; do nothing

Another way to make sure nothing happend would be to remvoe both the
widget and class bindings, but that will affect all widgets of that
class and is probably not a good thing to do.

-- 
Grant Edwards
Rosemount Inc.
grante_at_rosemount.com
Received on Fri Sep 30 1994 - 17:36:40 CET

This archive was generated by hypermail 2.3.0 : Mon Jul 21 2014 - 19:38:59 CEST