wxToggleButton(3)
π wxToggleButton π
okay bestie, welcome to the wxToggleButton manual from the Erlang Module Definition side of the world β yes it's a C++-flavoured wxWidgets thing but we're reading it through Erlang glasses and honestly? she's serving. β¨
π NAME π
wxToggleButton β no cap, this is a button that stays pressed when clicked by the user. like she does NOT bounce back, she commits. periodt. π
πΈ DESCRIPTION πΈ
so, in other words (and I do mean in other words, that's literally what the doc says), she's similar to wxCheckBox in functionality but she looks like a wxButton. a checkbox on the inside, a button on the outside. main character duality. π¦
since wxWidgets version 2.9.0 this control emits an update UI event. keep that in your notes bestie, it matters. π
you can see wxToggleButton in action in page_samples_widgets. go look, it's giving demo energy. π₯
See:
wxCheckBoxwxButton
This class is derived, and can use functions, from:
wxControlwxWindowwxEvtHandler
wxWidgets docs: wxToggleButton
β Events β
Event types emitted from this class:
command_togglebutton_clicked
like she's clicking AND toggling. we love a multitasking queen. π
π DATA TYPES π
wxToggleButton() :: wx:wx_object().
yes that's it. she IS a wx object. iconic, no notes. β¨
π FUNCTIONS π
hiii here's the whole roster, don't skip anyone, they all matter π
create(This, Parent, Id, Label, [Option]) -> boolean()
create(This, Parent, Id, Label, [Option]) -> boolean()
when
This :: wxToggleButton(),
Parent :: wxWindow:wxWindow(),
Id :: integer(),
Label :: unicode:chardata(),
Option ::
{pos, {X :: integer(), Y :: integer()}} |
{size, {W :: integer(), H :: integer()}} |
{style, integer()} |
{validator, wx:wx_object()}.
creates the toggle button for two-step construction. like, build first, decorate later. π
See new/4 for details. (she's basically the sibling function, we'll get there.)
destroy(This :: wxToggleButton()) -> ok
destroy(This :: wxToggleButton()) -> ok.
destroys the object. π rip little button, you did amazing sweetie.
okay so this one has no period at the end in the original and I'm respecting that, and yes it's just "Destroys the object" β nothing more, nothing less. don't read into it. π
getValue(This) -> boolean()
getValue(This) -> boolean() when This :: wxToggleButton().
gets the state of the toggle button. the vibe check, if you will. π«Ά
Return: Returns true if it is pressed, false otherwise. that's the whole tea. β
new() -> wxToggleButton()
new() -> wxToggleButton().
default constructor. she's the no-args girlie β shows up with nothing, ready for anything. π
new(Parent, Id, Label, [Option]) -> wxToggleButton()
new(Parent, Id, Label, [Option]) -> wxToggleButton()
when
Parent :: wxWindow:wxWindow(),
Id :: integer(),
Label :: unicode:chardata(),
Option ::
{pos, {X :: integer(), Y :: integer()}} |
{size, {W :: integer(), H :: integer()}} |
{style, integer()} |
{validator, wx:wx_object()}.
constructor, creating and showing a toggle button. note the and showing β she arrives ready to be perceived. π
See: create/5
setValue(This, State) -> ok
setValue(This, State) -> ok
when This :: wxToggleButton(), State :: boolean().
sets the toggle button to the given state. you tell her State, she becomes State. queen of taking direction. π
β οΈ important bestie, do not skip this: This does not cause a EVT_TOGGLEBUTTON event to be emitted. like, she changes, but she does NOT announce it. silent glow-up. no drama. (ok well, no event drama.) π
πΈ cute lil sign-off πΈ
that's the whole page babe, every option, every default, every type left exactly where it was β facts untouched, vibe upgraded. π
shoutout to Ericsson AB for this one, from the wx 2.6 era β and yes bestie, the manual page itself is wxToggleButton(3), so now you know exactly what you just read. go forth and toggle. π¦β¨
<tada>π mwah, bye π </tada>
π¦ 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