Tk 4 bindings and Scheme

From: Erik Ostrom <>
Date: Tue, 28 Nov 1995 16:40:16 -0500

In Tk 3, when a user event (like pressing a mouse button) occurred, Tk
searched for applicable bindings (to the widget class, specific window,
etc), and ran one of them. In Tk 4, it instead runs ALL of them.

I have a lot of cases in which I want to override the default binding of
a particular event in a particular window. Tk offers `bindtags', which
lets you set which bindings will be used and in which order, but it works
on a per-window basis, so if I want to eliminate the <ButtonRelease-2>
binding for a particular text window, I have to set bindtags to ignore
the text class binding, and then I have to COPY ALL THE OTHER BINDINGS
so that keyboard input, the other mouse buttons, and so on will all work
for my widget.

In Tcl, if you want to short-circuit the multiple bindings, you can have
the binding that gets run first use a `break' statement. This will not
only exit from the script it's running, but also stop Tk from running
the rest of the bindings it finds for the event. However, Scheme (and
therefore STk) has no `break' statement.

Has anyone else had this problem? Is there a good way to deal with it?

Received on Tue Nov 28 1995 - 22:42:17 CET

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