Basics
Guides
API Reference
Basics
Guides
API Reference
[430:14] static extends: object
Generated metadata helpers for ProgressBar class surfaces.
properties ()
Returns property metadata for
ProgressBar.
A list.[43:7] extends: object
Displays the progress of a long-running operation. GtkProgressBar provides
a visual clue that processing is underway. It can be used in two different
modes: percentage mode and activity mode.
GtkProgressBar in percentage mode and the user sees a growing bar
indicating the percentage of the work that has been completed. In this mode,
the application is required to call [method@Gtk.ProgressBar.set_fraction]
periodically to update the progress bar. When an application has no accurate
way of knowing the amount of work to do, it can use the GtkProgressBar in
activity mode, which shows activity by a block moving back and forth within
the progress area. In this mode, the application is required to call
[method@Gtk.ProgressBar.pulse] periodically to update the progress bar. There
is quite a bit of flexibility provided to control the appearance of the
GtkProgressBar. Functions are provided to control the orientation of the
bar, optional text can be displayed along with the bar, and the step size
used in activity mode can be set. # CSS nodes progressbar[.osd] ├── [text] ╰── trough[.empty][.full] ╰── progress[.pulse] GtkProgressBar
has a main CSS node with name progressbar and subnodes with names text and
trough, of which the latter has a subnode named progress. The text subnode is
only present if text is shown. The progress subnode has the style class
.pulse when in activity mode. It gets the style classes .left, .right, .top
or .bottom added when the progress 'touches' the corresponding end of the
GtkProgressBar. The .osd class on the progressbar node is for use in overlays
like the one Epiphany has for page loading progress. # Accessibility
GtkProgressBar uses the [enum@Gtk.AccessibleRole.progress_bar] role and
sets the [enum@Gtk.AccessibleProperty.value_min],
[enum@Gtk.AccessibleProperty.value_max] and
[enum@Gtk.AccessibleProperty.value_now] properties to reflect the progress.
ProgressBar ()
Creates a new
GtkProgressBar.
toNativeHandle (Source)
Normalizes a constructor argument into a raw pointer carrier. Accepts a raw NativeHandle, a raw NativeBuffer returned from
fn.call(...), another generated wrapper exposinghandle(), or null. Returns null when the argument carries no pointer.
Source is the raw handle, raw buffer, wrapper, or null.A raw pointer carrier or null when no pointer is present.getLib ()
Returns the opened native library for this generated wrapper.
The opened native library.handle ()
Returns the wrapped NativeHandle.
The wrapped NativeHandle.isNull ()
Returns true when the wrapped handle is null.
A bool.describe ()
Returns a small string for debugging generated wrappers.
A string.asWidget ()
Wraps this handle as
Widget.
A Widget object.asAccessible ()
Wraps this handle as
Accessible.
A Accessible object.asAccessibleRange ()
Wraps this handle as
AccessibleRange.
A AccessibleRange object.asBuildable ()
Wraps this handle as
Buildable.
A Buildable object.asConstraintTarget ()
Wraps this handle as
ConstraintTarget.
A ConstraintTarget object.asOrientable ()
Wraps this handle as
Orientable.
A Orientable object.getProperty (string Name)
Reads one generated property by name.
setProperty (string Name, Value)
Writes one generated property by name.
setEllipsize (string Value)
The preferred place to ellipsize the string. The text will be ellipsized if the progress bar does not have enough room to display the entire string, specified as a
PangoEllipsizeMode. Note that setting this property to a value other than %PANGO_ELLIPSIZE_NONE has the side-effect that the progress bar requests only enough space to display the ellipsis ("..."). Another means to set a progress bar's width is [method@Gtk.Widget.set_size_request].
Value is the new property value.None.setFraction (double Value)
The fraction of total work that has been completed.
Value is the new property value.None.setInverted (bool Value)
Invert the direction in which the progress bar grows.
Value is the new property value.None.setPulsestep (double Value)
The fraction of total progress to move the bounding block when pulsed.
Value is the new property value.None.setShowtext (bool Value)
Sets whether the progress bar will show a text in addition to the bar itself. The shown text is either the value of the [property@Gtk.ProgressBar:text] property or, if that is %NULL, the [property@Gtk.ProgressBar:fraction] value, as a percentage. To make a progress bar that is styled and sized suitably for showing text (even if the actual text is blank), set [property@Gtk.ProgressBar:show-text] to %TRUE and [property@Gtk.ProgressBar:text] to the empty string (not %NULL).
Value is the new property value.None.setText (string Value)
Text to be displayed in the progress bar.
Value is the new property value.None.get_ellipsize ()
Returns the ellipsizing position of the progress bar. See [method@Gtk.ProgressBar.set_ellipsize].
get_fraction ()
Returns the current fraction of the task that’s been completed.
get_inverted ()
Returns whether the progress bar is inverted.
get_pulse_step ()
Retrieves the pulse step. See [method@Gtk.ProgressBar.set_pulse_step].
get_show_text ()
Returns whether the
GtkProgressBarshows text. See [method@Gtk.ProgressBar.set_show_text].
get_text ()
Retrieves the text that is displayed with the progress bar. The return value is a reference to the text, not a copy of it, so will become invalid if you change the text in the progress bar.
pulse ()
Indicates that some progress has been made, but you don’t know how much. Causes the progress bar to enter “activity mode,” where a block bounces back and forth. Each call to [method@Gtk.ProgressBar.pulse] causes the block to move by a little bit (the amount of movement per pulse is determined by [method@Gtk.ProgressBar.set_pulse_step]).
None.set_ellipsize (string mode)
Sets the mode used to ellipsize the text. The text is ellipsized if there is not enough space to render the entire string.
mode is a PangoEllipsizeMode.None.set_fraction (double fraction)
Causes the progress bar to “fill in” the given fraction of the bar. The fraction should be between 0.0 and 1.0, inclusive.
fraction is fraction of the task that’s been completed.None.set_inverted (bool inverted)
Sets whether the progress bar is inverted. Progress bars normally grow from top to bottom or left to right. Inverted progress bars grow in the opposite direction.
inverted is %TRUE to invert the progress bar.None.set_pulse_step (double fraction)
Sets the fraction of total progress bar length to move the bouncing block. The bouncing block is moved when [method@Gtk.ProgressBar.pulse] is called.
fraction is fraction between 0.0 and 1.0.None.set_show_text (bool show_text)
Sets whether the progress bar will show text next to the bar. The shown text is either the value of the [property@Gtk.ProgressBar:text] property or, if that is %NULL, the [property@Gtk.ProgressBar:fraction] value, as a percentage. To make a progress bar that is styled and sized suitably for containing text (even if the actual text is blank), set [property@Gtk.ProgressBar:show-text] to %TRUE and [property@Gtk.ProgressBar:text] to the empty string (not %NULL).
show_text is whether to show text.None.set_text (string text)
Causes the given @text to appear next to the progress bar. If @text is %NULL and [property@Gtk.ProgressBar:show-text] is %TRUE, the current value of [property@Gtk.ProgressBar:fraction] will be displayed as a percentage. If @text is non-%NULL and [property@Gtk.ProgressBar:show-text] is %TRUE, the text will be displayed. In this case, it will not display the progress percentage. If
is the empty string, the progress bar will still be styled and sized suitably for containing text, as long as [property@Gtk.ProgressBar:show-text] is %TRUE.text is a UTF-8 string.None.
Aussom
Write once. Embed everywhere.
Copyright 2026 Austin Lehman. All rights reserved.