Creating custom events - Event Handling Overview vs. wxFormBuilder

chris elliott biol75 at york.ac.uk
Wed Feb 20 03:53:47 PST 2008



Lars Uffmann wrote:
> 
> Hey everyone!
> 
> I would like to create my own wxEvent, just a custom wxCommandEvent, no 
> derived wxEvent, so I read the Event Handling Overview at
> http://www.wxwidgets.org/manuals/2.6/wx_eventhandlingoverview.html
> 
> And this overview starts talking about macros (DECLARE_EVENT_TYPE, 
> DEFINE_EVENT_TYPE, BEGIN_EVENT_TABLE, END_EVENT_TABLE) which is _really_ 
> confusing me: 
This is only needed if you want a completly new kind of event. if you 
just have a need to send a wxCommandEvent you can do ProcessCommand(int 
id) (see your copy of the wxFrame docs) or

     wxCommandEvent e (wxEVT_COMMAND_MENU_SELECTED,iIndex); //10007
     wxWindow * pParent = GetParent();
     pParent->ProcessEvent (e);

chris







More information about the wx-users mailing list