wxFocusEvent(3erl)
π wxFocusEvent (like, the Erlang module definition bestie)
okay so welcome to wxFocusEvent, the Erlang module that's literally all about the wxFocusEvent class β¨ β and it's giving "glow up for your windows" energy, because it's all about focus. π
πΈ DESCRIPTION πΈ
A focus event gets sent when a window's focus changes, periodt. The window that's losing focus receives a "kill focus" event, while the window gaining it gets a "set focus" one. πβ‘οΈπ
Notice β and this is lowkey important β the set focus event happens both when the user gives focus to the window (whether that's with the mouse or the keyboard) and when it's done from the program itself using wxWindow:setFocus/1. So like, no cap, both paths fire it. π«Ά
The focus event handlers should almost invariably call wxEvent:skip/2 on their event argument to allow the default handling to take place. Not doing this may result in incorrect behaviour of the native controls, and we do NOT want that vibe. π Also note that a wxEVT_KILL_FOCUS handler must not call wxWindow:setFocus/1 β again, because it's not supported by all native controls. If you need to do this, consider using the Delayed Action Mechanism (not implemented in wx) described in the wxIdleEvent documentation.
fr fr, read that warning twice. The native controls are dramatic and will act out. π
See: Overview events
This class is derived (and can use functions) from: wxEvent
wxWidgets docs: wxFocusEvent
β EVENTS β
Use wxEvtHandler:connect/3 with wxFocusEventType to subscribe to events of this type. Slay, that's it, that's the whole vibe check. π¦
π§ DATA TYPES π§
wxFocusEvent() = wx:wx_object()
wxFocus() =
#wxFocus{type = wxFocusEvent:wxFocusEventType(),
win = wxWindow:wxWindow()}
wxFocusEventType() = set_focus | kill_focus
Two types, both iconic, set_focus and kill_focus. π
π EXPORTS π
getWindow(This) -> wxWindow:wxWindow()
Types:
This = wxFocusEvent()
Returns the window associated with this event β that is, the window which had the focus before for the wxEVT_SET_FOCUS event, and the window which is going to receive focus for the wxEVT_KILL_FOCUS one. π―
Warning: the window pointer may be NULL! π Check it, bestie, please check it.
and that's the whole page, main character energy complete. π
written by the wxWidgets team Β· wx 2.2.2.1 Β· wxFocusEvent(3erl) β mwah, go forth and handle your focus 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