SAMPLE APPLICATION-EVENT HANDLINNG
Event Tables are used:
BEGIN_EVENT_TABLE(MyFrame, wxFrame)
EVT_MENU(wxID_EXIT, MyFrame::OnExit)
EVT_BUTTON(BUTTON1, MyFrame::OnButton1)
END_EVENT_TABLE()
In the class definition, a DECLARE_EVENT_TABLE macro must be placed.
How it Works
When an event is received, wxWindows calls ProcessEvent of wxEventHandler on the first handler object belonging to the window that generates the event. wxWindow (and therefore all window classes) is derived from wxEventHandler. ProcessEvent searches the event in the event tables and calls zero or more event handler function(s).