wxStaticText(3erl)

πŸŽ€ NAME πŸŽ€

wxStaticText β€” Functions for wxStaticText class. This is the wxStaticText(3erl) page, aka an Erlang Module Definition, and yes bestie, we’re gonna get through it together. πŸ’–

✨ DESCRIPTION ✨

A static text control displays one or more lines of read-only text. It’s giving very read-only main character energy, and wxStaticText supports the three classic text alignments, label ellipsization (which is literally replacing parts of the text with the ellipsis "..." if the label doesn’t fit into the provided space), and also formatting markup with wxControl::SetLabelMarkup() (not implemented in wx). πŸ’…

🌸 Styles 🌸

This class supports the following styles:

(and that’s the whole styles list on this page β€” no extra items, no cap 🫢)

See: wxStaticBitmap, wxStaticBox. πŸ‘€

This class is derived (and can use functions) from: wxControl wxWindow wxEvtHandler.

wxWidgets docs: wxStaticText.

πŸ¦‹ DATA TYPES πŸ¦‹

wxStaticText() = wx:wx_object()

πŸ’– EXPORTS πŸ’–

✨ new() -> wxStaticText()

Default constructor. πŸŽ€

🌸 new(Parent, Id, Label) -> wxStaticText()

Types:

Parent = wxWindow:wxWindow()
Id = integer()
Label = unicode:chardata()

πŸ¦‹ new(Parent, Id, Label, Options :: [Option]) -> wxStaticText()

Types:

Parent = wxWindow:wxWindow()
Id = integer()
Label = unicode:chardata()
Option =
    {pos, {X :: integer(), Y :: integer()}} |
    {size, {W :: integer(), H :: integer()}} |
    {style, integer()}

Constructor, creating and showing a text control.

See: create/5.

⭐ create(This, Parent, Id, Label) -> boolean()

Types:

This = wxStaticText()
Parent = wxWindow:wxWindow()
Id = integer()
Label = unicode:chardata()

πŸ”₯ create(This, Parent, Id, Label, Options :: [Option]) -> boolean()

Types:

This = wxStaticText()
Parent = wxWindow:wxWindow()
Id = integer()
Label = unicode:chardata()
Option =
    {pos, {X :: integer(), Y :: integer()}} |
    {size, {W :: integer(), H :: integer()}} |
    {style, integer()}

Creation function, for two-step construction.

For details see new/4.

πŸ‘‘ getLabel(This) -> unicode:charlist()

Types:

This = wxStaticText()

Returns the control’s label, as it was passed to wxControl:setLabel/2.

Note that the returned string may contain mnemonics ("&" characters) if they were passed to the wxControl:setLabel/2 function; use GetLabelText() (not implemented in wx) if they are undesired. πŸ™ˆ

Also note that the returned string is always the string which was passed to wxControl:setLabel/2, but it may be different from the string passed to SetLabelText() (not implemented in wx) (since this last one escapes mnemonic characters).

πŸŽ€ setLabel(This, Label) -> ok

Types:

This = wxStaticText()
Label = unicode:chardata()

Change the label shown in the control.

Notice that since wxWidgets 3.1.1 this function is guaranteed not to do anything if the label didn’t really change, so there is no benefit to checking if the new label is different from the current one in the application code. Slay, no wasted vibe check. ✨

See: wxControl:setLabel/2.

🌈 wrap(This, Width) -> ok

Types:

This = wxStaticText()
Width = integer()

This function wraps the control’s label so that each of its lines becomes at most width pixels wide if possible (the lines are broken at words boundaries, so it might not be the case if words are too long).

If width is negative, no wrapping is done. Note that this width is not necessarily the total width of the control, since a few pixels for the border (depending on the control’s border style) may be added. πŸ¦‹

Since: 2.6.2.

πŸ’œ destroy(This :: wxStaticText()) -> ok

Destroys the object. Bye bestie. πŸ’…


Sign-off time: huge shoutout to the wxWidgets team 🫢 β€” this page is version wx 2.2.2.1, all about wxStaticText(3erl), and that’s the cute little footer energy. Mwah. πŸ’–βœ¨

πŸ“¦ where this page comes from