wxStdDialogButtonSizer(3)
π wxStdDialogButtonSizer β an Erlang module, bestie
okay so this is a page from the Erlang module docs (manual name wxStdDialogButtonSizer(3), in case you were wondering) and it's lowkey one of the most satisfying little widgets in wx. buckle up π
β¨ NAME β¨
wxStdDialogButtonSizer β this class creates button layouts which conform to the standard button spacing and ordering defined by the platform or toolkit's user interface guidelines (if such things exist). yes, if such things exist. iconic hedging. π
πΈ DESCRIPTION πΈ
By using this class, you can ensure that all your standard dialogs look correct on all major platforms. Currently it conforms to the Windows, GTK+ and macOS human interface guidelines. three whole platforms, no cap. π¦
When there aren't interface guidelines defined for a particular platform or toolkit, wxStdDialogButtonSizer reverts to the Windows implementation. (windows is the default friend who always shows up lol.)
To use this class, first add buttons to the sizer by calling addButton/2 (or setAffirmativeButton/2, setNegativeButton/2 or setCancelButton/2) and then call Realize in order to create the actual button layout used. Other than these special operations, this sizer works like any other sizer. so it's just a sizer with main character energy, fr fr. β¨
If you add a button with wxID_SAVE, on macOS the button will be renamed to "Save" and the wxID_NO button will be renamed to "Don't Save" in accordance with the macOS Human Interface Guidelines. apple said "we'll handle the vibes" π
See:
wxSizer- Overview sizer
wxDialog:createButtonSizer/2
This class is derived, and can use functions, from:
wxBoxSizerwxSizer
wxWidgets docs: wxStdDialogButtonSizer
π DATA TYPES π
wxStdDialogButtonSizer() :: wx:wx_object().
π₯ FUNCTIONS π₯
addButton(This, Button) -> ok
addButton(This, Button) -> ok
when
This :: wxStdDialogButtonSizer(),
Button :: wxButton:wxButton().
Adds a button to the wxStdDialogButtonSizer. π«
The button must have one of the following identifiers:
wxID_OKwxID_YESwxID_SAVEwxID_APPLYwxID_CLOSEwxID_NOwxID_CANCELwxID_HELPwxID_CONTEXT_HELP
bestie. it says must. pick from the list or this whole thing falls apart, and not in a cute way. π«Ά
destroy(This :: wxStdDialogButtonSizer()) -> ok
Destroys the object. bye queen π¦
new() -> wxStdDialogButtonSizer()
Constructor for a wxStdDialogButtonSizer. fresh out the box, brand new β¨
realize(This) -> ok when This :: wxStdDialogButtonSizer()
Rearranges the buttons and applies proper spacing between buttons to make them match the platform or toolkit's interface guidelines. this is the glow-up step, the final touch-up before the reveal π
setAffirmativeButton(This, Button) -> ok
setAffirmativeButton(This, Button) -> ok
when
This :: wxStdDialogButtonSizer(),
Button :: wxButton:wxButton().
Sets the affirmative button for the sizer. π
This allows you to use identifiers other than the standard identifiers outlined above. so you're not locked into the wxID_* list, you can do your own thing π
setCancelButton(This, Button) -> ok
setCancelButton(This, Button) -> ok
when
This :: wxStdDialogButtonSizer(),
Button :: wxButton:wxButton().
Sets the cancel button for the sizer. π
This allows you to use identifiers other than the standard identifiers outlined above. same deal, custom IDs welcome π
setNegativeButton(This, Button) -> ok
setNegativeButton(This, Button) -> ok
when
This :: wxStdDialogButtonSizer(),
Button :: wxButton:wxButton().
Sets the negative button for the sizer. no thanks, but make it β¨aestheticβ¨
This allows you to use identifiers other than the standard identifiers outlined above. yes bestie, freedom π§
ok that's the whole page, we consumed it, we understood it, we slayed π
and per the footer: this came from the wx manual, version 2.6, brought to you by Ericsson AB, dated as the page wxStdDialogButtonSizer(3) says so. 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