wxEvtHandler(3erl)
π NAME π
wxEvtHandler β the 3erl manualβs Erlang Module Definition for the wxEvtHandler class: functions for wxEvtHandler. π
π DESCRIPTION π
okay so bestie, wxEvtHandler is a class that can handle events from the windowing system. wxWindow is derived from this class β and therefore all window classes are too. no cap. π
To get events from wxwidgets objects, you subscribe to them by calling connect/3. β¨
If the callback option is not supplied, events are sent as messages.
These messages will be #wx{} where EventRecord is a record that depends on the wxEventType. The records are defined in: wx/include/wx.hrl. π«Ά
If a callback was supplied to connect, the callback will be invoked (in another process) to handle the event. The callback should be of arity 2.
fun Callback (EventRecord::wx(), EventObject::wxObject()).
Note: the callback will be executed in a new process each time. yes, each time, bestie. π
See: Overview events
wxWidgets docs: wxEvtHandler
π DATA TYPES π
hereβs the type tea, and it is iconic but also very long β keep every single module:type() exactly as shown, fr fr:
wxEvtHandler() = wx:wx_object()
wxEventType() =
wxActivateEvent:wxActivateEventType() |
wxAuiManagerEvent:wxAuiManagerEventType() |
wxAuiNotebookEvent:wxAuiNotebookEventType() |
wxBookCtrlEvent:wxBookCtrlEventType() |
wxCalendarEvent:wxCalendarEventType() |
wxChildFocusEvent:wxChildFocusEventType() |
wxClipboardTextEvent:wxClipboardTextEventType() |
wxCloseEvent:wxCloseEventType() |
wxColourPickerEvent:wxColourPickerEventType() |
wxCommandEvent:wxCommandEventType() |
wxContextMenuEvent:wxContextMenuEventType() |
wxDateEvent:wxDateEventType() |
wxDisplayChangedEvent:wxDisplayChangedEventType() |
wxDropFilesEvent:wxDropFilesEventType() |
wxEraseEvent:wxEraseEventType() |
wxFileDirPickerEvent:wxFileDirPickerEventType() |
wxFocusEvent:wxFocusEventType() |
wxFontPickerEvent:wxFontPickerEventType() |
wxGridEvent:wxGridEventType() |
wxHelpEvent:wxHelpEventType() |
wxHtmlLinkEvent:wxHtmlLinkEventType() |
wxIconizeEvent:wxIconizeEventType() |
wxIdleEvent:wxIdleEventType() |
wxInitDialogEvent:wxInitDialogEventType() |
wxJoystickEvent:wxJoystickEventType() |
wxKeyEvent:wxKeyEventType() |
wxListEvent:wxListEventType() |
wxMaximizeEvent:wxMaximizeEventType() |
wxMenuEvent:wxMenuEventType() |
wxMouseCaptureChangedEvent:wxMouseCaptureChangedEventType() |
wxMouseCaptureLostEvent:wxMouseCaptureLostEventType() |
wxMouseEvent:wxMouseEventType() |
wxMoveEvent:wxMoveEventType() |
wxNavigationKeyEvent:wxNavigationKeyEventType() |
wxPaintEvent:wxPaintEventType() |
wxPaletteChangedEvent:wxPaletteChangedEventType() |
wxQueryNewPaletteEvent:wxQueryNewPaletteEventType() |
wxSashEvent:wxSashEventType() |
wxScrollEvent:wxScrollEventType() |
wxScrollWinEvent:wxScrollWinEventType() |
wxSetCursorEvent:wxSetCursorEventType() |
wxShowEvent:wxShowEventType() |
wxSizeEvent:wxSizeEventType() |
wxSpinEvent:wxSpinEventType() |
wxSplitterEvent:wxSplitterEventType() |
wxStyledTextEvent:wxStyledTextEventType() |
wxSysColourChangedEvent:wxSysColourChangedEventType() |
wxTaskBarIconEvent:wxTaskBarIconEventType() |
wxTreeEvent:wxTreeEventType() |
wxUpdateUIEvent:wxUpdateUIEventType() |
wxWebViewEvent:wxWebViewEventType() |
wxWindowCreateEvent:wxWindowCreateEventType() |
wxWindowDestroyEvent:wxWindowDestroyEventType()
wx() =
#wx{id = integer(),
obj = wx:wx_object(),
userData = term(),
event = event()}
event() =
wxActivateEvent:wxActivate() |
wxAuiManagerEvent:wxAuiManager() |
wxAuiNotebookEvent:wxAuiNotebook() |
wxBookCtrlEvent:wxBookCtrl() |
wxCalendarEvent:wxCalendar() |
wxChildFocusEvent:wxChildFocus() |
wxClipboardTextEvent:wxClipboardText() |
wxCloseEvent:wxClose() |
wxColourPickerEvent:wxColourPicker() |
wxCommandEvent:wxCommand() |
wxContextMenuEvent:wxContextMenu() |
wxDateEvent:wxDate() |
wxDisplayChangedEvent:wxDisplayChanged() |
wxDropFilesEvent:wxDropFiles() |
wxEraseEvent:wxErase() |
wxFileDirPickerEvent:wxFileDirPicker() |
wxFocusEvent:wxFocus() |
wxFontPickerEvent:wxFontPicker() |
wxGridEvent:wxGrid() |
wxHelpEvent:wxHelp() |
wxHtmlLinkEvent:wxHtmlLink() |
wxIconizeEvent:wxIconize() |
wxIdleEvent:wxIdle() |
wxInitDialogEvent:wxInitDialog() |
wxJoystickEvent:wxJoystick() |
wxKeyEvent:wxKey() |
wxListEvent:wxList() |
wxMaximizeEvent:wxMaximize() |
wxMenuEvent:wxMenu() |
wxMouseCaptureChangedEvent:wxMouseCaptureChanged() |
wxMouseCaptureLostEvent:wxMouseCaptureLost() |
wxMouseEvent:wxMouse() |
wxMoveEvent:wxMove() |
wxNavigationKeyEvent:wxNavigationKey() |
wxPaintEvent:wxPaint() |
wxPaletteChangedEvent:wxPaletteChanged() |
wxQueryNewPaletteEvent:wxQueryNewPalette() |
wxSashEvent:wxSash() |
wxScrollEvent:wxScroll() |
wxScrollWinEvent:wxScrollWin() |
wxSetCursorEvent:wxSetCursor() |
wxShowEvent:wxShow() |
wxSizeEvent:wxSize() |
wxSpinEvent:wxSpin() |
wxSplitterEvent:wxSplitter() |
wxStyledTextEvent:wxStyledText() |
wxSysColourChangedEvent:wxSysColourChanged() |
wxTaskBarIconEvent:wxTaskBarIcon() |
wxTreeEvent:wxTree() |
wxUpdateUIEvent:wxUpdateUI() |
wxWebViewEvent:wxWebView() |
wxWindowCreateEvent:wxWindowCreate() |
wxWindowDestroyEvent:wxWindowDestroy()
thatβs the whole type situation β wx() is the #wx{} record, and event() is the matching event-record union. slay. π¦
π EXPORTS π
π connect/2 and connect/3 β subscribe era
connect(This :: wxEvtHandler(), EventType :: wxEventType()) -> ok
connect(This :: wxEvtHandler(),
EventType :: wxEventType(),
Options :: [Option]) ->
ok
Types:
Option =
{id, integer()} |
{lastId, integer()} |
{skip, boolean()} |
callback |
{callback, function()} |
{userData, term()}
This function subscribes to events. π¬
Subscribes to events of type EventType, in the range id, lastId.
The events will be received as messages if no callback is supplied.
β¨ Options
id:{id, integer()}β the identifier (or first of the identifier range) to be associated with this event handler. Default is?wxID_ANY.lastid:{lastId,integer()}β the second part of the identifier range. If used,'id'must be set as the starting identifier range. Default is?wxID_ANY.skip:{skip,boolean()}β ifskipistrue, further event_handlers will be called. This is not used if the'callback'option is used. Default isfalse.callback:{callback,function()}β use acallbackfun(EventRecord::wx(),EventObject::wxObject())to process the event. Default not specified i.e. a message will be delivered to the process calling this function.userData:{userData,term()}β an Erlang term that will be sent with the event. Default:[].
πͺ disconnect/1, disconnect/2, and disconnect/3 β unsubscribe vibes
disconnect(This :: wxEvtHandler()) -> boolean()
disconnect(This :: wxEvtHandler(), EventType :: wxEventType()) ->
boolean()
disconnect(This :: wxEvtHandler(),
EventType :: wxEventType(),
Opts :: [Option]) ->
boolean()
Types:
Option =
{id, integer()} | {lastId, integer()} | {callback,
function()}
This function unsubscribes the process or callback fun from the event handler. π
EventType may be the atom 'null' to match any eventtype. Notice that the options skip and userdata are not used to match the eventhandler.
made with Gen Z group-chat energy and exact Unix-manual facts β source/version/date tea from the footer: wxWidgets team, wx 2.2.2.1, wxEvtHandler(3erl) ππ«Ά
π¦ where this page comes from
- ubuntu noble: erlang-manpages 1:25.3.2.8+dfsg-1ubuntu4 Β· Apache-2.0
- ubuntu noble: erlang-manpages 1:25.3.2.8+dfsg-1ubuntu4.8 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms