wxChildFocusEvent(3)

πŸ“¦
version 29.0.6 Β· 3 versions
, in ubuntu stonking

✨ wxChildFocusEvent ✨

okay bestie, welcome to the wxChildFocusEvent era of the Erlang manual pages, a.k.a. wxChildFocusEvent(3) πŸ’– this one's a sweet little module definition and it's honestly giving "quietly essential" energy, so let's get into it πŸ’…


🌸 NAME 🌸

wxChildFocusEvent β€” a child focus event gets sent to a (parent-)window when one of its child windows gains focus, so the window can restore focus back to its corresponding child later, if it loses it now and regains it later. lowkey thoughtful of it tbh 🫢


πŸ¦‹ DESCRIPTION πŸ¦‹

okay so important vibe check first: the child window here means the direct child of the window that's receiving the event. don't get it twisted 😌 if you wanna know which window is actually getting the focus, you hit up wxWindow:findFocus/0.

See: Overview events πŸ‘€

Now, this class is derived β€” and can use functions β€” from:

  • wxCommandEvent
  • wxEvent

it's giving "built different, but the family is iconic" 🌈

wxWidgets docs: wxChildFocusEvent

πŸŽ€ Events πŸŽ€

to subscribe to events of this type, use wxEvtHandler:connect/3 with wxChildFocusEventType. that's the whole ritual, no cap ✨


πŸ’œ DATA TYPES πŸ’œ

  • wxChildFocus() :: #wxChildFocus{}.
  • wxChildFocusEvent() :: wx:wx_object().
  • wxChildFocusEventType() :: child_focus.

short, sweet, no crumbs πŸ’…


πŸ‘‘ FUNCTIONS πŸ‘‘

  • getWindow(This) -> wxWindow:wxWindow() when This :: wxChildFocusEvent().

this one returns the direct child that receives the focus, or a (grand-)parent of the control receiving the focus. so like, it's the family tree situation, not always the main character 😭

and if you want the actually focused control? that's wxWindow:findFocus/0. periodt πŸ’–


ngl if you skip wxWindow:findFocus/0 and assume getWindow/1 hands you the truly focused widget, that's a plot twist you did not want, bestie. read the above twice. i'm serious 🫢

okay that's the whole page!! πŸŽ€βœ¨ this iconic little doc comes to you courtesy of Ericsson AB, from wx 2.6 β€” no date on this footer so we're just gonna assume it's timeless, and honestly? main character energy. bye bestie, go read Overview events next πŸŒΈπŸ¦‹πŸ’œ

πŸ“¦ where this page comes from