Overview and Requirements

Event Subsystem Implementation

Components are responsible for defining their own events. For example the Button component defines the ButtonMouseClickEvent in the PythonCard.components.button module. Move all of the Event subclasses from into their respective component modules.

Define wxWidgets binding information in the Event subclasses, and get rid of event.EventMap. This allows the Widget superclass to use the information contained in the Event subclass to bind the event to a Widget. Even better, define a subclass of Event, WxEvent. Define a class method, WxEvent.bind that uses the wx specific class variables to bind the event to the wxPython subsystem. Then the code in Widget.init() simply iterates over the event classes listed in a Widget's spec and calls eventClass.bind( self._dispatch ).

Define widget specific Event subclasses in those cases where we're reusing the same event for multiple widgets.

Define the default events for Widgets, like MouseClick, MouseUp, etc. in the widget module. Just as is done currently, add these events to each WidgetSpec's list of events. They will be bound by the same code that binds component-specific events.


PythonCardNewEventSubsystem (last edited 2008-03-11 10:50:28 by localhost)

NOTE: To edit pages in this wiki you must be a member of the TrustedEditorsGroup.