wxChoice(3)

πŸ“¦
version 29.0.6 Β· 3 versions
, in ubuntu stonking

πŸ’– NAME πŸ’–

wxChoice β€” a choice item is used to select one of a list of strings. bestie it's literally a dropdown, go off πŸ‘‘


✨ DESCRIPTION ✨

Okay so picture a wxListBox but make it mysterious. Unlike a wxListBox, only the selection is visible until the user pulls down the menu of choices. it's giving ✨mysterious✨, it's giving "you'll see me when i want you to see me" πŸ’…

πŸŽ€ Styles

This class supports the following styles:

  • wxCB_SORT β€” sorts the entries alphabetically. alphabetize her, she deserves it πŸ”€βœ¨

See:

  • wxListBox
  • wxComboBox
  • wxCommandEvent

This class is derived, and can use functions, from:

  • wxControlWithItems
  • wxControl
  • wxWindow
  • wxEvtHandler

wxWidgets docs: wxChoice

not her having a whole ancestral lineage 😭 four classes deep and still slaying, we love generational talent πŸ’œ

πŸ¦‹ Events

Event types emitted from this class:

  • command_choice_selected

like she's literally screaming at you when someone picks something, iconic behavior fr fr πŸ“£


🌈 DATA TYPES 🌈

wxChoice() :: wx:wx_object().

that's it. that's the whole type. simple. clean. main character energy πŸ‘‘


🫢 FUNCTIONS 🫢

🌸 create(This, Parent, Id, Pos, Size, Choices, [Option]) -> boolean()

create(This, Parent, Id, Pos, Size, Choices, [Option]) ->
                boolean()
                when
                    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()}.

it makes the thing, bestie. it returns a boolean and we're not asking questions ✨

🌸 delete(This, N) -> ok

delete(This, N) -> ok when This :: wxChoice(), N :: integer().

Deletes an item from the control. bye girl, we hardly knew ye πŸ‘‹πŸ˜­

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.

🚨 okay real talk, do not come at her with a negative index or an index >= the number of items. she WILL assert-fail in debug builds and it will be embarrassing for everyone πŸ’€

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.

so like. selection above the deletion = safe and sound 🫢. selection below = she's gone, invalidated, no notes πŸ™ˆ

See: wxControlWithItems:clear/1

🌸 destroy(This :: wxChoice()) -> ok

destroy(This :: wxChoice()) -> ok.

Destroys the object. rip boo you would've loved the dropdown menu πŸ’€πŸ•ŠοΈ

🌸 getColumns(This) -> integer()

getColumns(This) -> integer() when 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 everything else she's just gonna hand you a 1 and act like that's normal 😭 ngl that's so real of her

🌸 new() -> wxChoice()

new() -> wxChoice().

Default constructor. bare. minimal. a whole vibe 🌸

See: create/7

🌸 new(Parent, Id, [Option]) -> wxChoice()

new(Parent, Id, [Option]) -> wxChoice()
             when
                 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. yes she does both, she's a multitasker, obsessed πŸ’…βœ¨

See: create/7

🌸 setColumns(This, [Option]) -> ok

setColumns(This, [Option]) -> ok
                          when This :: wxChoice(), Option :: {n, integer()}.

Sets the number of columns in this choice item. get you a girl who can do both 🌈

Remark: This is implemented for GTK and Motif only and doesn’t do anything under other platforms. like literally nothing. she's just standing there. πŸ§β™€οΈπŸ’€


and that's the whole page bestie, you ate that πŸ’–βœ¨πŸŽ€πŸ¦‹πŸŒΈ

out here repping Ericsson AB, riding with wx 2.6 β€” periodt, no cap, and that's the wxChoice(3) tea πŸ‘‘πŸ’…πŸŒŸ

πŸ“¦ where this page comes from