An Introduction to Tkinter
前页 | Chapter 44. Basic Widget Methods | 后页

# Event callbacks

All event callbacks take one argument; an event descriptor. See the introduction for more information on this descriptor.

## bind

`bind(sequence, callback)`, `bind(sequence, callback, "+")`. Add an event binding to self. Usually, the new binding replaces any existing binding for the same event sequence. The second form can be used to add the new callback to the existing binding.

## unbind

`unbind(sequence)`. Remove any bindings for the given event sequence, for self.

## bind_all

`bind_all(sequence, callback)`, `bind_all(sequence, callback, "+")`. Add an event binding to the application level. Usually, the new binding replaces any existing binding for the same event sequence. The second form can be used to add the new callback to the existing binding.

## unbind_all

`unbind_all(sequence)`. Remove any bindings for the given event sequence, on the application level.

## bind_class

`bind_class(class, sequence, func)`, `bind_class(class, sequence, func, "+")`. Add an event binding to the given widget class. Usually, the new binding replaces any existing binding for the same event sequence. The second form can be used to add the new callback to the existing binding.

## unbind_class

`unbind_class(class, sequence)`. Remove any bindings for the given event sequence, for the given binding class.

## bindtags

`bindtags()`. Return a tuple containing the binding search order used for self. By default, this tuple contains the self's widget name (str(self)), the widget class (e.g. Button), the root window's name, and finally the special name all which refers to the application level.

## bindtags

`bindtags(bindings)`. Modify the binding search order for self.

前页 | Home | 后页
Event processing | Up | Alarm handlers and other non-event callbacks