wxChoice(3erl)
π NAME π
wxChoice(3erl) is the page, and the manual name is Erlang Module Definition. Itβs the Erlang module definition for the wxChoice class β dropdown-select realness, bestie. π¦
β¨ DESCRIPTION β¨
A choice item is used to select one of a list of strings. Unlike a wxListBox, only the selection is visible until the user pulls down the menu of choices. Itβs giving βclosed until you clickβ energy. π
π Styles π
This class supports the following styles:
The page says βthe following stylesβ and then the list is empty, so Iβm not gonna hallucinate one for you π.
See: wxListBox, wxComboBox, wxCommandEvent
This class is derived (and can use functions) from: wxControlWithItems wxControl wxWindow wxEvtHandler
wxWidgets docs: wxChoice
π₯ EVENTS π₯
Event types emitted from this class: command_choice_selected
π§ DATA TYPES π§
wxChoice() = wx:wx_object()
π EXPORTS π
new() -> wxChoice()
Default constructor. No cap, it just makes one.
See: create/7, wxValidator (not implemented in wx)
new(Parent, Id) -> wxChoice()
Types:
Parent = wxWindow:wxWindow()
Id = integer()
new(Parent, Id, Options :: [Option]) -> wxChoice()
Types:
Parent = wxWindow:wxWindow()
Id = integer()
Option =
{pos, {X :: integer(), Y :: integer()}} |
{size, {W :: integer(), H :: integer()}} |
{choices, [unicode:chardata()]} |
{style, integer()} |
{validator, wx:wx_object()}
Constructor, creating and showing a choice.
See: create/7, wxValidator (not implemented in wx)
destroy(This :: wxChoice()) -> ok
Destructor, destroying the choice item.
create(This, Parent, Id, Pos, Size, Choices) -> boolean()
Types:
This = wxChoice()
Parent = wxWindow:wxWindow()
Id = integer()
Pos = {X :: integer(), Y :: integer()}
Size = {W :: integer(), H :: integer()}
Choices = [unicode:chardata()]
create(This, Parent, Id, Pos, Size, Choices, Options :: [Option]) -> boolean()
Types:
This = wxChoice()
Parent = wxWindow:wxWindow()
Id = integer()
Pos = {X :: integer(), Y :: integer()}
Size = {W :: integer(), H :: integer()}
Choices = [unicode:chardata()]
Option = {style, integer()} | {validator, wx:wx_object()}
delete(This, N) -> ok
Types:
This = wxChoice()
N = integer()
Deletes an item from the control.
The client data associated with the item will be also deleted if it is owned by the control. Note that it is an error (signalled by an assert failure in debug builds) to remove an item with the index negative or greater or equal than the number of items in the control. Thatβs the dramatic part β do not test fate. π
If there is a currently selected item below the item being deleted, i.e. if wxControlWithItems:getSelection/1 returns a valid index greater than or equal to n, the selection is invalidated when this function is called. However if the selected item appears before the item being deleted, the selection is preserved unchanged.
See: wxControlWithItems:clear/1
getColumns(This) -> integer()
Types:
This = wxChoice()
Gets the number of columns in this choice item.
Remark: This is implemented for GTK and Motif only and always returns 1 for the other platforms. So on other platforms itβs lowkey always 1, iykyk. π«Ά
setColumns(This) -> ok
Types:
This = wxChoice()
The page gives just the type here β no extra prose for this arity, so Iβm not making one up. π
setColumns(This, Options :: [Option]) -> ok
Types:
This = wxChoice()
Option = {n, integer()}
Sets the number of columns in this choice item.
Remark: This is implemented for GTK and Motif only and doesnβt do anything under other platforms.
Cute sign-off: brought to you by wxWidgets team, version wx 2.2.2.1, page wxChoice(3erl) β and thereβs no date in the footer, so Iβm not inventing one, periodt. π
ππ«Ά
π¦ 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