wxMenuEvent(3)
π NAME π
wxMenuEvent β the class that handles a whole rainbow of menu-related events π
β¨ DESCRIPTION β¨
okay bestie, listen up. wxMenuEvent is used for a variety of menu-related events. that's the vibe.
but β and this is important β these do NOT include menu command events. those are a whole different girl and they're handled using wxCommandEvent objects. don't mix them up, i'm begging π
Events of this class get generated by both:
- menus that are part of a
wxMenuBar, attached towxFrame, and - popup menus shown by
wxWindow:popupMenu/4.
They get sent to the following objects, in order, until one of them handles the event π
- The menu object itself, as returned by
GetMenu(), if any. - The
wxMenuBarto which this menu is attached, if any. - The window associated with the menu β e.g. the one calling
PopupMenu()for the popup menus. - The top level parent of that window, if it's different from the window itself.
This is similar to command events generated by the menu items, but, unlike them, wxMenuEvent are only sent to the window itself and its top level parent β not any of the intermediate windows in the hierarchy. no middlemen. periodt π
The default handler for wxEVT_MENU_HIGHLIGHT in wxFrame displays help text in the status bar, see wxFrame:setStatusBarPane/2.
See:
wxCommandEvent- Overview events
This class is derived, and can use functions, from:
wxEvent
wxWidgets docs: wxMenuEvent πΈ
π¦ Events π¦
Use wxEvtHandler:connect/3 with wxMenuEventType to subscribe to events of this type. that's the whole ritual, go off β¨
π DATA TYPES π
wxMenu() :: #wxMenu{}.
wxMenuEvent() :: wx:wx_object().
wxMenuEventType() :: menu_open | menu_close | menu_highlight.
π₯ FUNCTIONS π₯
getMenu(This) -> wxMenu:wxMenu() when This :: wxMenuEvent().
Returns the menu which is being opened or closed, or the menu containing the highlighted item. very "which one of u is it" energy π΅οΈββοΈ
Note that the returned value can beNULLif the menu being opened doesn't have a correspondingwxMenu, e.g. this happens when opening the system menu in wxMSW port. so likeβ¦ check before u use it bestie π
Remark: Since 3.1.3 this function can be used with OPEN, CLOSE and HIGHLIGHT events. Before 3.1.3, this method can only be used with the OPEN and CLOSE events. glow-up confirmed β¨
getMenuId(This) -> integer() when This :: wxMenuEvent().
Returns the menu identifier associated with the event.
This method should be only used with the HIGHLIGHT events. it's picky like that π
isPopup(This) -> boolean() when This :: wxMenuEvent().
Returns true if the menu which is being opened or closed is a popup menu, false if it is a normal one. vibe check: popup or no π
This method should only be used with the OPEN and CLOSE events.
and that's the whole page, bestie β no cap, every flag and note accounted for π«Ά
this lil masterpiece comes courtesy of Ericsson AB, sitting proudly in the wx 2.6 era, and it's officially the wxMenuEvent(3) page. tysm for reading, mwah π
π¦ where this page comes from
- ubuntu stonking: erlang-doc 1:29.0.6+dfsg-1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms