wxStatusBar(3)
β¨ NAME β¨
wxStatusBar β okay so bestie, picture this: a status bar is a narrow little window that you can park along the bottom of a frame, and its whole job is to serve tiny amounts of status info. That's it. That's the vibe. π
This is the Erlang module definition, and I'm gonna walk you through every single bit. No cap. π
π¦ DESCRIPTION π¦
It can hold one or more fields, and one or more of those fields can be variable length depending on how big the window is. Flexible queen behavior. π
wxStatusBar also keeps its own independent stack of status texts for each field β that's the pushStatusText/3 and popStatusText/2 situation, and yes you're gonna love it.
Heads up bestie: in wxStatusBar land, the words pane and field? Synonyms. Same thing. Don't let anyone gaslight you. π«Ά
π Styles
This class supports the following styles, and I need you to read all of them, not just skim:
wxSTB_SIZEGRIPβ shows a gripper on the right-hand side of the status bar, which you can grab to resize the parent window. It's giving "drag me, I dare you". πwxSTB_SHOW_TIPSβ shows tooltips for those panes whose status text got ellipsized/truncated because the status text doesn't fit the pane width. Real ones know this style only does anything onwxGTK(with GTK+ >= 2.12) right now. Sorry to the other platforms, not sorry. πwxSTB_ELLIPSIZE_STARTβ replaces the beginning of the status texts with an ellipsis when the status text widths exceed the status bar pane's widths (useswxControl::Ellipsize(not implemented in wx)).wxSTB_ELLIPSIZE_MIDDLEβ replaces the middle of the status texts with an ellipsis when the status text widths exceed the status bar pane's widths (useswxControl::Ellipsize(not implemented in wx)).wxSTB_ELLIPSIZE_ENDβ replaces the end of the status texts with an ellipsis when the status text widths exceed the status bar pane's widths (useswxControl::Ellipsize(not implemented in wx)).wxSTB_DEFAULT_STYLEβ the default style, the moment, the icon: it includeswxSTB_SIZEGRIP|wxSTB_SHOW_TIPS|wxSTB_ELLIPSIZE_END|wxFULL_REPAINT_ON_RESIZE.
Remark (aka the important lore): it is possible to create controls and other windows on the status bar. Position these windows from an OnSize() event handler. Don't skip that part. π₯
Remark (aka the other important lore): notice that only the first 127 characters of a string will be shown in status bar fields under Windows if a proper manifest indicating that the program uses version 6 of the common controls library is not used. This is a limitation of the native control on these platforms. Yes, 127. Exactly 127. Not 128. We don't make the rules. π
See:
wxFrame- Examples
This class is derived, and can use functions, from:
wxWindowwxEvtHandler
wxWidgets docs: wxStatusBar
π DATA TYPES π
wxStatusBar() :: wx:wx_object().
That's the whole type. Clean. Minimal. Iconic. β¨
π FUNCTIONS π
create(This, Parent, [Option]) -> boolean()
create(This, Parent, [Option]) -> boolean()
when
This :: wxStatusBar(),
Parent :: wxWindow:wxWindow(),
Option :: {winid, integer()} | {style, integer()}.
Creates the window β this is the one you use for that two-step construction life. π οΈ
See new/2 for details.
destroy(This :: wxStatusBar()) -> ok.
Destroys the object. π Bye bestie, you had a good run.
getFieldRect(This, I) -> Result
getFieldRect(This, I) -> Result
when
Result ::
{Res :: boolean(),
Rect ::
{X :: integer(),
Y :: integer(),
W :: integer(),
H :: integer()}},
This :: wxStatusBar(),
I :: integer().
Returns the size and position of a field's internal bounding rectangle. π
Return: true if the field index is valid, false otherwise.
See: {X,Y,W,H}
getFieldsCount(This) -> integer() when This :: wxStatusBar().
Returns the number of fields in the status bar. Just the count. How many lil guys are up in there. π’
getStatusText(This, [Option]) -> unicode:charlist()
getStatusText(This, [Option]) -> unicode:charlist()
when
This :: wxStatusBar(),
Option :: {number, integer()}.
Returns the string associated with a status bar field.
Return: the status field string if the field is valid, otherwise the empty string.
See: setStatusText/3
new() -> wxStatusBar().
Default ctor. No arguments, no drama, just vibes. π
new(Parent, [Option]) -> wxStatusBar()
new(Parent, [Option]) -> wxStatusBar()
when
Parent :: wxWindow:wxWindow(),
Option :: {winid, integer()} | {style, integer()}.
Constructor, creating the window. The main character entrance. π
See: create/3
popStatusText(This, [Option]) -> ok
popStatusText(This, [Option]) -> ok
when
This :: wxStatusBar(),
Option :: {number, integer()}.
Restores the text to the value it had before the last call to pushStatusText/3. The un-push. The undo. πͺ
Notice: ifsetStatusText/3had been called in the meanwhile,popStatusText/2will not change the text. i.e. it does not override explicit changes to status text β it only restores the saved text if it hadn't been changed since. Respect the boundaries, bestie. π«Ά
See: pushStatusText/3
pushStatusText(This, String, [Option]) -> ok
pushStatusText(This, String, [Option]) -> ok
when
This :: wxStatusBar(),
String :: unicode:chardata(),
Option :: {number, integer()}.
Saves the current field text in a per-field stack, and sets the field text to the string passed as argument. It's giving "hold my place real quick". πβ¨
See: popStatusText/2
setFieldsCount(This, Number, [Option]) -> ok
setFieldsCount(This, Number, [Option]) -> ok
when
This :: wxStatusBar(),
Number :: integer(),
Option :: {widths, [integer()]}.
Sets the number of fields, and optionally the field widths. Two birds, one gorj function. π¦
setMinHeight(This, Height) -> ok
setMinHeight(This, Height) -> ok
when This :: wxStatusBar(), Height :: integer().
Sets the minimal possible height for the status bar.
The real height may be bigger than the height specified here, depending on the size of the font used by the status bar. So likeβ¦ minimum means minimum, bestie. π
setStatusStyles(This, Styles) -> ok
setStatusStyles(This, Styles) -> ok
when
This :: wxStatusBar(),
Styles :: [integer()].
Sets the styles of the fields in the status line, which can make fields appear flat or raised instead of the standard sunken 3D border. Flat, raised, sunken β pick your aesthetic. π¨
setStatusText(This, Text, [Option]) -> ok
setStatusText(This, Text, [Option]) -> ok
when
This :: wxStatusBar(),
Text :: unicode:chardata(),
Option :: {number, integer()}.
Sets the status text for the i-th field. π―
The given text will replace the current text. The display of the status bar is updated immediately, so there is no need to call wxWindow:update/1 after calling this function. Instant. Gratification. π₯
Note: ifpushStatusText/3had been called before, the new text will also replace the last saved value, to make sure that the next call topopStatusText/2doesn't restore the old value, which was overwritten by the call to this function. Nobody wants a zombie status text coming back from the dead. π§
See:
getStatusText/2wxFrame:setStatusText/3
setStatusWidths(This, Widths_field) -> ok
setStatusWidths(This, Widths_field) -> ok
when
This :: wxStatusBar(),
Widths_field :: [integer()].
Sets the widths of the fields in the status line. This one's lowkey the most interesting, so buckle up. π’
There are two types of fields: fixed widths and variable width fields. For the fixed width fields you should specify their (constant) width in pixels. For the variable width fields, specify a negative number which indicates how the field should expand: the space left for all variable width fields is divided between them according to the absolute value of this number. A variable width field with width of -2 gets twice as much of it as a field with width -1 and so on. β¨ Math but make it cute. β¨
For example, to create one fixed width field of width 100 in the right part of the status bar and two more fields which get 66% and 33% of the remaining space correspondingly, you should use an array containing -2, -1 and 100.
Remark: the widths of the variable fields are calculated from the total width of all fields, minus the sum of widths of the non-variable fields, divided by the number of variable fields. Write that down. π
See:
setFieldsCount/3wxFrame:setStatusWidths/2
And that's the whole page, bestie!! πβ¨ Every flag, every field, every stack, every 127-character Windows caveat. You ate this. π
This lil manual page was brought to you by Ericsson AB, for wx 2.6, and it's the wxStatusBar page (you already knew that tho). Thanks for reading all the way to the end, you're literally the main character. π«Άππ
π¦ 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