General List of all Events?

Robin Dunn robin at alldunn.com
Thu Oct 19 09:12:21 PDT 2006


Michael B. Trausch wrote:
> Michael B. Trausch wrote:
>> Kevin Hock wrote:
>>> Mike,
>>>
>>> Is this what you are looking for?
>>>
>>> http://www.wxwindows.org/manuals/2.6.3/wx_eventhandlingoverview.html#eventmacros
>>>
>> Loosely -- it at least has hyperlinks from which I think I can compile
>> such a list.
>>
>> Thanks!
>>
> 
> Actually, looking a bit closer at it, I am not sure.  These look like
> they're defined macros to assist creating handlers... 

In wxPython the EVT_THINGS are not macros like in C++, or even functions 
like they used to be in earlier versions, but are instances of the 
wx.PyEventBinder class.  They encapsulate what is needed to make the 
connection between a type of event, the event target and a handler.

> are these the
> things that would be used with the Bind() call in wxPython? 

Yes.

Longer answer: Sort of.


> I am still
> trying to figure out how handling events work... I don't understand the
> Bind() method just yet, either.

It boils down to essentially just a wrapper around the C++ 
wxEvtHandler::Connect method.  It just hides some of the more mundane 
details that you don't need to know about from wxPython.  So for 
example, instead of typing this:

     self.Connect(someItem.GetId(), wx.ID_ANY, 
wx.wxEVT_COMMAND_MENU_SELECTED, self.OnDoSomething)

you can use this:

     self.Bind(wx.EVT_MENU, self.OnDoSomething, someItem)

-- 
Robin Dunn
Software Craftsman
http://wxPython.org  Java give you jitters?  Relax with wxPython!





More information about the wx-users mailing list