Differences between revisions 7 and 8
Revision 7 as of 2006-07-14 03:07:23
Size: 1394
Editor: 207
Comment:
Revision 8 as of 2008-03-11 10:50:25
Size: 1394
Editor: localhost
Comment: converted to 1.6 markup
Deletions are marked like this. Additions are marked like this.
Line 5: Line 5:
[[TableOfContents]] <<TableOfContents>>

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.