[Go to site: main page, start]

Advanced Events in wxPython

Abstract

  • Since most GUI-applications are meant to merely "react" to user's action, event-programming is a good strategy to write GUI-applications. In this article, we shall describe the way events are processed in wxPython 2.6, and present the complete hierarchy of events used in wxPython.

Introduction

  • Event Handling is a complex enough matter in wxPython to be treated as a separate subject. We shall, here, try to present it as exhaustively as possible. Someday?

Hierarchy of Events

  • In wxPython, Events' base classes are wxEvent. Try the following code to assure yourself of it:

    >>> import wx
    >>> issubclass(wxCloseEvent,wxEvent)
    True

    And:

    >>> issubclass(wxCloseEvent,wxEventPtr)
    False

Event processing

  • Use Bind() to bind wxObjects to wxEvents. Generally, self.Bind(wx.SOME_EVENT, callbackFn, self.boundObject). I dunno, that's a pretty crap example but hey it's something... As I dig around in this more I'll post more, but I'm just a n00b. --TomPlunket

Resources

In the wxPython XXX

AdvancedEvents (last edited 2008-03-11 10:50:25 by localhost)

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