wxToggleButton(3erl)
π wxToggleButton (3erl) β Erlang Module Definition
okay so bestie, welcome to wxToggleButton β the Erlang module page for the wxToggleButton class, and honestly? it's giving "checkbox but make it fashion." let's get into it π
β¨ DESCRIPTION β¨
wxToggleButton is a button that stays pressed when you click it. yes, that's the whole vibe. it's a button that commits. π
in other words, it is similar to wxCheckBox in functionality but looks like a wxButton. so it does the checkbox thing but serves button looks. icon behavior, honestly.
since wxWidgets version 2.9.0 this control emits an update UI event. periodt. β¨
you can see wxToggleButton in action in page_samples_widgets β go look, it's cute.
see: wxCheckBox, wxButton, wxBitmapToggleButton (not implemented in wx β sad, i know π)
this class is derived (and can use functions) from: wxControl wxWindow wxEvtHandler β so it inherited the whole family's powers, main character energy fr fr π
wxWidgets docs: wxToggleButton
πΈ EVENTS πΈ
event types emitted from this class: command_togglebutton_clicked
like yes, that's the one. that's the event. write it down. π
π¦ DATA TYPES π¦
wxToggleButton()=wx:wx_object()β it's a wx object bestie, that's it, that's the type.
β¨ EXPORTS β¨ (the good stuff)
π new() -> wxToggleButton()
default constructor. no args, no thoughts, just vibes. π«Ά
π new(Parent, Id, Label) -> wxToggleButton()
types:
Parent = wxWindow:wxWindow()
Id = integer()
Label = unicode:chardata()
π new(Parent, Id, Label, Options :: [Option]) -> wxToggleButton()
types:
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. this is the one where you get to customize β position, size, style, validator, the whole aesthetic β¨
see: create/5, wxValidator (not implemented in wx)
π destroy(This :: wxToggleButton()) -> ok
destructor, destroying the toggle button. it's over bestie, say bye ππ
π create(This, Parent, Id, Label) -> boolean()
types:
This = wxToggleButton()
Parent = wxWindow:wxWindow()
Id = integer()
Label = unicode:chardata()
π create(This, Parent, Id, Label, Options :: [Option]) -> boolean()
types:
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. the way that this is just the build-later route π
see new/4 for details β same options, same energy.
π getValue(This) -> boolean()
types:
This = wxToggleButton()
gets the state of the toggle button. a little vibe check, if you will π
return: returns true if it is pressed, false otherwise. simple as that. π
π setValue(This, State) -> ok
types:
This = wxToggleButton()
State = boolean()
sets the toggle button to the given state. you pick pressed or not-pressed, and it obeys. π
β οΈ heads up bestie β this does not cause a EVT_TOGGLEBUTTON event to be emitted. no event, no notification, nothing. it just... changes. silently. so don't sit there waiting for a callback that's never coming π
π and that's the whole page!! every flag, every type, every signature β nothing skipped, no cap.
kisses from the wxWidgets team π this was wx 2.2.2.1, mwah, bye bestie!! πβ¨π¦
π¦ where this page comes from
- ubuntu noble: erlang-manpages 1:25.3.2.8+dfsg-1ubuntu4 Β· Apache-2.0
- ubuntu noble: erlang-manpages 1:25.3.2.8+dfsg-1ubuntu4.8 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms