wxStaticBox(3erl)

🌸 NAME 🌸

okay bestie, welcome to wxStaticBox(3erl) β€” the Erlang Module Definition page for wxStaticBox. It's giving functions for the wxStaticBox class, periodt. πŸ’…

✨ DESCRIPTION ✨

A static box is literally a rectangle drawn around other windows to denote a logical grouping of items. iconic behavior for grouping your little UI children.

Note that while previous versions required that windows appearing inside a static box be created as its siblings (i.e. use the same parent as the static box itself), since wxWidgets 2.9.1 it is also possible to create them as children of wxStaticBox itself β€” and you are actually encouraged to do it like this if compatibility with the previous versions is not important. slay.

So the new recommended way to create static box is:

While the compatible β€” and now deprecated β€” way is:

⚠️ yes bestie, deprecated means exactly what it sounds like: the compatible way is now deprecated. The page says so, not me. πŸ’€

Also note that there is a specialized wxSizer class (wxStaticBoxSizer) which can be used as an easier way to pack items into a static box. cute.

See: wxStaticText, wxStaticBoxSizer

This class is derived (and can use functions) from: wxControl wxWindow wxEvtHandler

wxWidgets docs: wxStaticBox

πŸŽ€ DATA TYPES πŸŽ€

wxStaticBox() = wx:wx_object()

πŸ’… EXPORTS πŸ’…

  • new() -> wxStaticBox() β€” default constructor. no thoughts, just a fresh static box.
  • new(Parent, Id, Label) -> wxStaticBox() β€” the three-arg constructor. types are exactly these:
Parent = wxWindow:wxWindow()
Id = integer()
Label = unicode:chardata()
  • new(Parent, Id, Label, Options :: [Option]) -> wxStaticBox() β€” constructor, creating and showing a static box. See: create/5.
Parent = wxWindow:wxWindow()
Id = integer()
Label = unicode:chardata()
Option =
    {pos, {X :: integer(), Y :: integer()}} |
    {size, {W :: integer(), H :: integer()}} |
    {style, integer()}
  • destroy(This :: wxStaticBox()) -> ok β€” okay so the original page has a whole formatting situation here: the text under this export starts with β€œConstructor for a static box using the given window as label.” I'm preserving it exactly, bestie β€” don't come for me. 😭

This constructor takes a pointer to an arbitrary window (although usually a wxCheckBox or a wxRadioButton) instead of just the usual text label and puts this window at the top of the box at the place where the label would be shown.

The label window must be a non-null, fully created window and will become a child of this wxStaticBox, i.e. it will be owned by this control and will be deleted when the wxStaticBox itself is deleted.

An example of creating a wxStaticBox with window as a label:

Currently this constructor is only available in wxGTK and wxMSW, use wxHAS_WINDOW_LABEL_IN_STATIC_BOX to check whether it can be used at compile-time.

Since: 3.1.1 Destructor, destroying the group box.

  • create(This, Parent, Id, Label) -> boolean() β€” types first:
This = wxStaticBox()
Parent = wxWindow:wxWindow()
Id = integer()
Label = unicode:chardata()
  • create(This, Parent, Id, Label, Options :: [Option]) -> boolean() β€” creates the static box for two-step construction. See new/4 for further details.
This = wxStaticBox()
Parent = wxWindow:wxWindow()
Id = integer()
Label = unicode:chardata()
Option =
    {pos, {X :: integer(), Y :: integer()}} |
    {size, {W :: integer(), H :: integer()}} |
    {style, integer()}

shoutout to the wxWidgets team β€” this footer is wx 2.2.2.1, and the page is wxStaticBox(3erl). the footer didn't hand me a date, so no invented date era, bestie πŸ’–

πŸ“¦ where this page comes from