Inheritance diagram for wx.EvtHandler:
A class that can handle events from the windowing system. wx.Window (and therefore all window classes) are derived from this class.
When events are received, wx.EvtHandler invokes the method listed in the event table using itself as the object.
When using multiple inheritance it is imperative that the wx.EvtHandler (-derived) class be the first class inherited such that the “self” pointer for the overall object will be identical to the “self” pointer for the wx.EvtHandler portion.
wx.App, wx.BitmapButton, wx.BookCtrlBase, wx.Button, wx.CheckBox, wx.CheckListBox, wx.Choice, wx.Choicebook, wx.CollapsiblePane, wx.ColourDialog, wx.ColourPickerCtrl, wx.ComboBox, wx.ContextHelpButton, wx.Control, wx.ControlWithItems, wx.DatePickerCtrl, wx.DatePickerCtrlBase, wx.Dialog, wx.DirDialog, wx.DirFilterListCtrl, wx.DirPickerCtrl, wx.FileDialog, wx.FilePickerCtrl, wx.FindReplaceDialog, wx.FontDialog, wx.FontPickerCtrl, wx.Frame, wx.Gauge, wx.GenericDatePickerCtrl, wx.GenericDirCtrl, wx.HtmlListBox, wx.HyperlinkCtrl, wx.ListBox, wx.ListCtrl, wx.ListView, wx.Listbook, wx.MDIChildFrame, wx.MDIClientWindow, wx.MDIParentFrame, wx.Menu, wx.MenuBar, wx.MessageDialog, wx.MiniFrame, wx.MultiChoiceDialog, wx.Notebook, wx.NotebookPage, wx.NumberEntryDialog, wx.Panel, wx.PasswordEntryDialog, wx.PickerBase, wx.PopupTransientWindow, wx.PopupWindow, wx.PreviewCanvas, wx.PreviewControlBar, wx.PreviewFrame, wx.Process, wx.ProgressDialog, wx.PyApp, wx.PyAxBaseWindow, wx.PyControl, wx.PyEvtHandler, wx.PyPanel, wx.PyPreviewControlBar, wx.PyPreviewFrame, wx.PyScrolledWindow, wx.PySimpleApp, wx.PyTimer, wx.PyValidator, wx.PyWidgetTester, wx.PyWindow, wx.RadioBox, wx.RadioButton, wx.SashLayoutWindow, wx.SashWindow, wx.ScrollBar, wx.ScrolledWindow, wx.SearchCtrl, wx.SimpleHtmlListBox, wx.SingleChoiceDialog, wx.Slider, wx.SpinButton, wx.SpinCtrl, wx.SplashScreen, wx.SplashScreenWindow, wx.SplitterWindow, wx.StaticBitmap, wx.StaticBox, wx.StaticLine, wx.StaticText, wx.StatusBar, wx.TaskBarIcon, wx.TextCtrl, wx.TextEntryDialog, wx.Timer, wx.TipWindow, wx.ToggleButton, wx.ToolBar, wx.ToolBarBase, wx.Toolbook, wx.TopLevelWindow, wx.TreeCtrl, wx.Treebook, wx.VListBox, wx.VScrolledWindow, wx.Validator, wx.Window
The difference between sending an event (using the ProcessEvent method) and posting it is that in the first case the event is processed before the function returns, while in the second case, the function returns immediately and the event will be processed sometime later (usually during the next event loop iteration).
A copy of event is made by the function, so the original can be deleted as soon as function returns (it is common that the original is created on the stack). This requires that the wx.Event.Clone method be implemented by event so that it can be duplicated and stored until it gets processed.
This is also the method to call for inter-thread communication - it will post events safely between different threads which means that this method is thread-safe by using critical sections where needed. In a multi-threaded program, you often need to inform the main GUI thread about the status of other working threads and such notification should be done using this method.
This method automatically wakes up idle handling if the underlying window system is currently idle and thus would not send any idle events. (Waking up idle handling is done calling wx.WakeUpIdle).
The normal order of event table searching is as follows:
This function posts an event to be processed later.
Parameters:
Note
The difference between sending an event (using the ProcessEvent method) and posting it is that in the first case the event is processed before the function returns, while in the second case, the function returns immediately and the event will be processed sometime later (usually during the next event loop iteration).
Bind an event to an event handler.
Parameters:
Connects the given function dynamically with the event handler, id and event type. This is an alternative to the use of static event tables.
Parameters:
Disconnects the given function dynamically from the event handler, using the specified parameters as search criteria and returning True if a matching function has been found and removed. This method can only disconnect functions which have been added using the Connect method.
Parameters:
Returns:
bool
Returns True if the event handler is enabled, False otherwise.
Returns:
bool
See also
Gets the pointer to the next handler in the chain.
Returns:
See also
SetNextHandler, GetPreviousHandler, SetPreviousHandler, wx.Window.PushEventHandler, wx.Window.PopEventHandler
Gets the pointer to the previous handler in the chain.
Returns:
See also
SetPreviousHandler , GetNextHandler , SetNextHandler , wx.Window.PushEventHandler , wx.Window.PopEventHandler
Processes an event, searching event tables and calling zero or more suitable event handler function(s).
Parameters:
Returns:
bool
Note
Normally, your application would not call this function: it is called in the wxWidgets implementation to dispatch incoming user interface events to the framework (and application). However, you might need to call it if implementing new functionality (such as a new control) where you define new event types, as opposed to allowing the user to override functions.
An instance where you might actually override the ProcessEvent function is where you want to direct event processing to event handlers not normally noticed by wxWidgets. For example, in the document/view architecture, documents and views are potential event handlers. When an event reaches a frame, ProcessEvent will need to be called on the associated document and view in case event handler functions are associated with these objects.
The normal order of event table searching is as follows:
Enables or disables the event handler.
Parameters:
Note
You can use this function to a having to remove the event handler from the chain, for example when implementing a dialog editor and changing from edit to test mode.
See also
Sets the pointer to the next handler.
Parameters:
See also
GetNextHandler, SetPreviousHandler, GetPreviousHandler, wx.Window.PushEventHandler, wx.Window.PopEventHandler
Sets the pointer to the previous handler.
Parameters:
Disconnects the event handler binding for event from self. Returns True if successful.
Parameters: