Tkinter difference between and <>

Bindings that have a single set of brackets are built-in events directly supported by the underlying OS. Examples include <KeyPress>, <ButtonPress-1>, <Configure>, and many more. Most of the built-in events are directly tied to actual physical events such as pressing a mouse button or key on the keyboard.

Bindings with double-brackets are called virtual events. They do not necessarily represent any sort of physical event, and typically (though not always) are unique to specific widgets. For example, <<ListboxSelect>> is only used by the listbox, <<NotebookTabChanged>> is only used by the ttk notebook, and so on.

Virtual events can be triggered by a combination of other events using the event_add widget method, though they can also be generated by calling event_generate.

The tcl/tk man pages includes a list of predefined virtual events.

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top