wxPopupWindow(3)

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

πŸ’– wxPopupWindow πŸ’–

okay bestie, so the manual name is wxPopupWindow(3) and it's an Erlang Module Definition, and honestly? she's a baddie. let's get into it. ✨


🌸 NAME 🌸

wxPopupWindow β€” a special kind of top level window used for popup menus, combobox popups and such. like, the little guy that pops up when you click something. main character energy fr fr πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

✨ Styles ✨

this class supports the following styles, no cap:

  • wxPU_CONTAINS_CONTROLS β€” okay so here's the tea 🍡: by default in wxMSW, a popup window will not take focus from its parent window. sounds fine, right? except so many standard controls β€” including common ones such as wxTextCtrl β€” need focus to function correctly and will literally not work when placed on a default popup. this flag can be used to make the popup take focus and let all controls work, but at the price of not allowing the parent window to keep focus while the popup is shown, which can also sometimes be desirable. it's giving tradeoff 😭. this style is currently only implemented in MSW and simply does nothing under the other platforms (it's new since wxWidgets 3.1.3).

See:

  • wxDialog
  • wxFrame

this class is derived, and can use functions, from:

  • wxWindow
  • wxEvtHandler

wxWidgets docs: wxPopupWindow πŸ‘‘


πŸ’œ DATA TYPES πŸ’œ

wxPopupWindow() :: wx:wx_object().

πŸŽ€ FUNCTIONS πŸŽ€

  • create(This, Parent, [Option]) -> boolean()
when
    This :: wxPopupWindow(),
    Parent :: wxWindow:wxWindow(),
    Option :: {flags, integer()}.

Create method for two-step creation. yep, that's the whole vibe 🫢

  • destroy(This :: wxPopupWindow()) -> ok.

Destroys the object. rip bozo πŸ’€

  • new() -> wxPopupWindow().

Default constructor. no thoughts, head empty, just vibes ✨

  • new(Parent, [Option]) -> wxPopupWindow()
when
    Parent :: wxWindow:wxWindow(),
    Option :: {flags, integer()}.

Constructor. iconic behavior πŸŽ€

  • position(This, PtOrigin, SizePopup) -> ok
when
    This :: wxPopupWindow(),
    PtOrigin :: {X :: integer(), Y :: integer()},
    SizePopup :: {W :: integer(), H :: integer()}.

Move the popup window to the right position, i.e. such that it is entirely visible. lowkey the whole point, ngl πŸ‘‘

The popup is positioned at ptOrigin + size if it opens below and to the right (default), at ptOrigin - sizePopup if it opens above and to the left etc. math is mathing πŸ”₯


heads up bestie: that wxPU_CONTAINS_CONTROLS focus thing? read it twice. the parent-loses-focus part is real and it will sneak up on you 😭

and that's the whole page, periodt πŸ’… this lil beauty comes to you from Ericsson AB, version wx 2.6 β€” mwah, stan forever πŸ«ΆπŸ’–βœ¨

πŸ“¦ where this page comes from