wxGauge(3)
π wxGauge π
okay bestie, so this is the page for the Erlang module definition of wxGauge β it's one of the wx gang, straight outta Erlang/OTP's wx bindings. pull up a chair π«Ά
β¨ NAME β¨
wxGauge β a gauge is a horizontal or vertical bar which shows a quantity (often time). it's giving "loading, please wait" but make it β¨aestheticβ¨
πΈ DESCRIPTION πΈ
so wxGauge is that lil bar that justβ¦ vibes and tells you how much of a thing is done. and it's lowkey flexible because it supports two working modes: determinate and indeterminate progress. two moods, one widget π
the first one β determinate β is the usual working mode (see setValue/2 and setRange/2). you know the vibe: bar fills up, you know where you're at, main character energy β¨
the second one is what you pull out when the program is doing some processing but you don't know how much progress is being done. no clue, no clue at all π. in this case, you can periodically call the pulse/1 function to make the progress bar switch to indeterminate mode. graphically it's usually a set of blocks which move or bounce in the bar control π¦ β yeah, the little bouncing blocks. iconic.
and the best part? wxGauge supports dynamic switch between these two work modes. it can switch up mid-scenario, no drama π
also, fyi: there are no user commands for the gauge. that's it, that's the whole story.
π Styles π
this class supports the following styles (periodt):
wxGA_HORIZONTALβ creates a horizontal gauge.wxGA_VERTICALβ creates a vertical gauge.wxGA_SMOOTHβ creates smooth progress bar with one pixel wide update step (not supported by all platforms π«€).wxGA_TEXTβ display the current value in percents in the gauge itself. this style is only supported in wxQt and ignored under the other platforms. this flag is only available in wxWidgets 3.1.0 and later.wxGA_PROGRESSβ reflect the value of gauge in the application taskbar button under Windows 7 and later and the dock icon under macOS, ignored under the other platforms. this flag is only available in wxWidgets 3.1.0 and later.
π See: π
wxSliderwxScrollBar
𧬠family tree (this class is derived, and can use functions, from:) π§¬
wxControlwxWindowwxEvtHandler
wxWidgets docs: wxGauge π
π¦ DATA TYPES π¦
wxGauge() :: wx:wx_object().
yep. that's the one. it's a wx:wx_object() and we love that for it π
π FUNCTIONS π
create(This, Parent, Id, Range, [Option]) -> boolean()
when
This :: wxGauge(),
Parent :: wxWindow:wxWindow(),
Id :: integer(),
Range :: integer(),
Option ::
{pos, {X :: integer(), Y :: integer()}} |
{size, {W :: integer(), H :: integer()}} |
{style, integer()} |
{validator, wx:wx_object()}.
creates the gauge for two-step construction.
see new/4 for further details π
destroy(This :: wxGauge()) -> ok.
destroys the object π (in the polite, memory-freeing sense)
getRange(This) -> integer() when This :: wxGauge().
returns the maximum position of the gauge.
See: setRange/2
getValue(This) -> integer() when This :: wxGauge().
returns the current position of the gauge.
See: setValue/2
isVertical(This) -> boolean() when This :: wxGauge().
returns true if the gauge is vertical (has wxGA_VERTICAL style) and false otherwise. vibe check passed β
new() -> wxGauge().
default constructor.
new(Parent, Id, Range, [Option]) -> wxGauge()
when
Parent :: wxWindow:wxWindow(),
Id :: integer(),
Range :: integer(),
Option ::
{pos, {X :: integer(), Y :: integer()}} |
{size, {W :: integer(), H :: integer()}} |
{style, integer()} |
{validator, wx:wx_object()}.
constructor, creating and showing a gauge. it's born AND it's visible, multitasking queen β¨
See: create/5
pulse(This) -> ok when This :: wxGauge().
switch the gauge to indeterminate mode (if required) and makes the gauge move a bit to indicate the user that some progress has been made. little bounce, big communication π¦
Note: after calling this function the value returned bygetValue/1is undefined and thus you need to explicitly callsetValue/2if you want to restore the determinate mode. no cap, that value is gone β plan accordingly π
setRange(This, Range) -> ok
when This :: wxGauge(), Range :: integer().
sets the range (maximum value) of the gauge.
this function makes the gauge switch to determinate mode, if it's not already.
when the gauge is in indeterminate mode, under wxMSW the gauge repeatedly goes from zero to range and back; under other ports when in indeterminate mode, the range setting is ignored. π«
See: getRange/1
setValue(This, Pos) -> ok when This :: wxGauge(), Pos :: integer().
sets the position of the gauge.
the pos must be between 0 and the gauge range as returned by getRange/1, inclusive. don't try it, bestie π
this function makes the gauge switch to determinate mode, if it was in indeterminate mode before. glow-up moment β¨
See: getValue/1
and that's the whole page, bestie π this lil slice of the docs came to you courtesy of Ericsson AB, from wx 2.6, and it lives at wxGauge(3). go make a progress bar that slays π₯π
π¦ 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