wxStaticText(3)
π¦ wxStaticText(3) β Erlang Module Definition π¦
okay bestie sit down, hydrate, and let me tell you about wxStaticText, the wxStaticText(3) page from the Erlang module definitions. it's giving "quiet little label that does exactly what it says on the tin" and honestly? we stan a low-drama control. π
πΈ NAME πΈ
wxStaticText β a static text control displays one or more lines of read-only text. that's it, that's the whole personality. read-only, no notes, no cap. π
β¨ DESCRIPTION β¨
okay so here's the tea: wxStaticText supports the three classic text alignments, it does label ellipsization (that's when you replace parts of the text with the ellipsis, literally "...", if the label doesn't fit into the provided space), and it also does formatting markup with wxControl::SetLabelMarkup() β which, heads up, is not implemented in wx. π
π Styles π
this class supports the following styles, and no we are not skipping any of them:
wxALIGN_LEFTβ align the text to the left.wxALIGN_RIGHTβ align the text to the right.wxALIGN_CENTRE_HORIZONTALβ center the text (horizontally).wxST_NO_AUTORESIZEβ by default, the control will adjust its size to exactly fit to the size of the text whensetLabel/2is called. if this style flag is given, the control will not change its size. this style is especially useful with controls which also have thewxALIGN_RIGHTor thewxALIGN_CENTRE_HORIZONTALstyle, because otherwise they won't make sense any longer after a call tosetLabel/2. lowkey a whole plot twist ngl.wxST_ELLIPSIZE_STARTβ if the labeltext width exceeds the control width, replace the beginning of the label with an ellipsis; useswxControl::Ellipsize(not implemented in wx).wxST_ELLIPSIZE_MIDDLEβ if the label text width exceeds the control width, replace the middle of the label with an ellipsis; useswxControl::Ellipsize(not implemented in wx).wxST_ELLIPSIZE_ENDβ if the label text width exceeds the control width, replace the end of the label with an ellipsis; useswxControl::Ellipsize(not implemented in wx).
See: π«Ά
wxStaticBitmapwxStaticBox
This class is derived, and can use functions, from:
wxControlwxWindowwxEvtHandler
family tree ate, fr fr. π
wxWidgets docs: wxStaticText
π DATA TYPES π
wxStaticText() :: wx:wx_object().
one type, one legend. β
π FUNCTIONS π
π create/5
create(This, Parent, Id, Label, [Option]) -> boolean()
when
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. that's the whole vibe β you build it in two separate moments like a lil glow-up montage. β¨
for details see new/4.
π§ destroy/1
destroy(This :: wxStaticText()) -> ok.
destroys the object. bye bestie, it was real. π
πΈ getLabel/1
getLabel(This) -> unicode:charlist() when This :: wxStaticText().
returns the control's label, as it was passed to wxControl:setLabel/2.
note that the returned string may contains 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 may be different from the string passed to SetLabelText() (not implemented in wx) (since this last one escapes mnemonic characters). the way that & keeps popping up... π
π¦ new/0
new() -> wxStaticText().
default constructor. no args, no stress, main character energy. π
π new/4
new(Parent, Id, Label, [Option]) -> wxStaticText()
when
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. iconic β it does both in one go, no waiting around. π₯
See: create/5
π
setLabel/2
setLabel(This, Label) -> ok
when
This :: wxStaticText(),
Label :: unicode:chardata().
change the label shown in the control. so simple. so powerful.
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. literally zero benefit, don't waste your precious code lines bestie. π
See: wxControl:setLabel/2
π wrap/2
wrap(This, Width) -> ok
when This :: wxStaticText(), Width :: integer().
this functions wraps the controls 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). long words said "not today". π
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 controls border style) may be added.
Since: 2.6.2 β a classic, an elder, an icon. β
okay that's genuinely the whole page, no skips, no summaries, every flag accounted for. vibe check: passed. β
and that's a wrap (pun fully intended π) β this lil love letter came to you from Ericsson AB, wx 2.6, and it lives at wxStaticText(3). slay, bye, go label something. πβ¨ππ¦π
π¦ 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