What terminology do I need to understand events

This chapter contains a lot of terminology, much of which begins with the word event. Table 3.1 is a quick reference guide to the terms we'll be using.

Table 3.1 Event terms

Term

Definition

event

Something that happens during your application that requires a response.

event object

The concrete representation of an event in wxPython including data attributes that encapsulate the specifics of the event. Events are represented as instances of the wx.Event class and its subclasses, such as wx.CommandEvent and wx.MouseEvent.

continued on next page continued on next page

Table 3.1 Event terms (continued)

Term

Definition

event type

An integer ID that wxPython adds to every event object. The event type gives further information about the nature of the event. For example, the event type of a wx.MouseEvent indicates whether the event is a mouse click or a mouse move.

event source

Any wxPython object that creates events. Examples are buttons, menu items, list boxes, or any other widget.

event-driven

A program structure where the bulk of time is spent waiting for, or responding to, events.

event queue

A continuously maintained list of events that have already occurred, but have not yet been processed.

event handler

A written function or method that is called in response to an event. Also called a handler function or handler method.

event binder

A wxPython object that encapsulates the relationship between a specific widget, a specific event type, and an event handler. In order to be invoked, all event handlers must be registered with an event binder.

wx.EvtHandler

A wxPython class that allows its instances to create a binding between an event binder of a specific type, an event source, and an event handler. Note that the class wx.EvtHandler is not the same thing as an event handler function or method defined previously.

We hope this table will keep you from getting your event handlers mixed up with your event binders. Please refer to this table throughout the chapter as necessary. We'll begin with a general overview of event-driving programming, and then we'll discuss the specifics of how everything is managed in wxPython.

Was this article helpful?

0 0

Post a comment