wxSingleChoiceDialog(3)
β¨ wxSingleChoiceDialog β¨
okay bestie, gather round π this is an Erlang module page, and the module is literally called wxSingleChoiceDialog. Say it with me. Iconic name, no notes. π
π NAME π
wxSingleChoiceDialog β this class represents a dialog that shows a list of strings, and allows the user to select one. One. Just one. Singular. The moment where you have to commit to a choice and the dialog is like "pick π«Ά".
πΈ DESCRIPTION πΈ
So here's the tea: double-clicking on a list item is equivalent to single-clicking and then pressing OK. Same energy, fewer steps, no cap. β¨
π¦ Styles π¦
This class supports the following styles, and yes you can mix and match:
wxOKβ show an OK button. Obviously. πwxCANCELβ show a Cancel button. The escape hatch, we love her. πwxCENTREβ centre the message. Main character energy, perfectly framed. π
See also, because besties share their faves:
- Overview cmndlg
wxMultiChoiceDialog(her sister who lets you pick many, we stan both π)
This class is derived, and can use functions, from:
wxDialogwxTopLevelWindowwxWindowwxEvtHandler
Up the whole family tree, fr fr. π³
wxWidgets docs: wxSingleChoiceDialog
β DATA TYPES β
wxSingleChoiceDialog() :: wx:wx_object().
That's it. That's the type. Clean, minimal, slay. π
π₯ FUNCTIONS π₯
destroy/1 π
destroy(This :: wxSingleChoiceDialog()) -> ok.
Destroys the object. It's giving "goodbye forever, bestie" π β the dialog is gone, the object is gone, the vibes are cleared.
getSelection/1 π
getSelection(This) -> integer()
when This :: wxSingleChoiceDialog().
Returns the index of selected item. Yes bestie, an index, not the string β that's a different function and we'll get there, patience my love π§
getStringSelection/1 π
getStringSelection(This) -> unicode:charlist()
when This :: wxSingleChoiceDialog().
Returns the selected string. The actual text. unicode:charlist() and everything, look at her go β¨
new/5 π
new(Parent, Message, Caption, Choices, [Option]) ->
wxSingleChoiceDialog()
when
Parent :: wxWindow:wxWindow(),
Message :: unicode:chardata(),
Caption :: unicode:chardata(),
Choices :: [unicode:chardata()],
Option ::
{style, integer()} |
{pos, {X :: integer(), Y :: integer()}}.
Constructor, taking an array of wxString (not implemented in wx) choices and optional client data. That parenthesis is important, bestie β not implemented in wx, so don't come for me when it's not there π
Remark: use wxDialog:showModal/1 to show the dialog. Constructing it does not summon it. You gotta show it. Periodt. π
Options you can pass: {style, integer()} and {pos, {X :: integer(), Y :: integer()}} β position her wherever she deserves, which is absolutely centre stage. π
setSelection/2 π
setSelection(This, Selection) -> ok
when
This :: wxSingleChoiceDialog(),
Selection :: integer().
Sets the index of the initially selected item. So when the dialog opens, she's already standing there, pre-picked, looking gorgeous π¦ ok comes back and nothing else. Simply.
π SEE ALSO π
- Overview cmndlg
wxMultiChoiceDialogwxDialogwxTopLevelWindowwxWindowwxEvtHandler- wxWidgets docs:
wxSingleChoiceDialog
and that's the whole page, bestie, we ate and left no crumbs π½οΈβ¨ this was brought to you by Ericsson AB, tag wx 2.6, on this module's page for wxSingleChoiceDialog(3). iykyk π«Άπ
π¦ 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