wxEvent(3erl)
π wxEvent β okay bestie, let's talk events
So this is wxEvent(3erl), straight out of the Erlang module definitions, and it's literally the base class for every event in wxWidgets. Let's get into it π«Ά
β¨ DESCRIPTION β¨
An event is, like, a structure holding info about an event that gets passed to a callback or a member function. That's the whole vibe.
wxEvent used to be a multipurpose event object (iconic of it, honestly), and now it's the abstract base class for all the other event classes β see below, bestie π
For more info about events, go check out the overview_events overview. It's giving required reading.
See: wxCommandEvent, wxMouseEvent
wxWidgets docs: wxEvent
π DATA TYPES π
wxEvent()=wx:wx_object()
π₯ EXPORTS π₯
getId(This) -> integer()
Types:
This = wxEvent()
Returns the identifier associated with this event β like a button command id. It's the event's little name tag π
getSkipped(This) -> boolean()
Types:
This = wxEvent()
Returns true if the event handler should be skipped, false otherwise. Simple as that, no cap.
getTimestamp(This) -> integer()
Types:
This = wxEvent()
Gets the timestamp for the event.
Okay so the timestamp is the time in milliseconds since some fixed moment β and heads up, it's not necessarily the standard Unix Epoch, so only the differences between timestamps usually make sense, not their absolute values. Don't be out here comparing timestamps to your clock, bestie π
β οΈ Warning: wxWidgets returns a non-NULLtimestamp only for mouse and key events (seewxMouseEventandwxKeyEvent). So for everything else? Null. Nothing. Crickets. π
isCommandEvent(This) -> boolean()
Types:
This = wxEvent()
Returns true if the event is or is derived from wxCommandEvent, else it returns false.
Note: exists only for optimization purposes. It's not doing anything deep, it's just fast. Respect tho.
resumePropagation(This, PropagationLevel) -> ok
Types:
This = wxEvent()
PropagationLevel = integer()
Sets the propagation level to the given value β for example, a value returned from an earlier call to stopPropagation/1. It's the "ok we're back on" button π¦
shouldPropagate(This) -> boolean()
Types:
This = wxEvent()
Tests if this event should be propagated or not β aka, is the propagation level currently greater than 0? That's it, that's the whole check β¨
skip(This) -> ok
Types:
This = wxEvent()
(The one-arg version. Short, sweet, does the thing.)
skip(This, Options :: [Option]) -> ok
Types:
This = wxEvent()
Option = {skip, boolean()}
This method can be used inside an event handler to control whether further event handlers bound to this event will be called after the current one returns. Very main character of it.
Without skip/2 (or equivalently, if Skip(false) is used), the event will not be processed any more. If Skip(true) is called, the event processing system continues searching for a further handler function for this event β even though it's already been processed in the current handler. So it keeps the search going π₯
In general, it's recommended to skip all non-command events to allow the default handling to take place. Command events, though, are normally not skipped β because usually a single command like a button click or a menu item selection must only be processed by one handler. One handler, one job, periodt π
stopPropagation(This) -> integer()
Types:
This = wxEvent()
Stops the event from propagating to its parent window. π
Returns the old propagation level value, which you may later pass to resumePropagation/2 to allow propagating the event again. So keep that return value, bestie β it's your way back in π
and that's the whole page, you ate that π
Cute little sign-off: this gem comes to you from the wxWidgets team, version wx 2.2.2.1, and it's the wxEvent(3erl) page β go forth and handle your events responsibly πβ¨
π¦ 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