gtk.progress_bar

Module for [ProgressBar] class

Types 3

The #GtkProgressBar is typically used to display the progress of a long running operation. It provides a visual clue that processing is underway. The GtkProgressBar can be used in two different modes: percentage mode and activity mode.

When an application can determine how much work needs to take place (e.g. read a fixed number of bytes from a file) and can monitor its progress, it can use the 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 gtk.progress_bar.ProgressBar.setFraction 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 gtk.progress_bar.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.

Methods
GType _getGType() static nothrow
GType _gType() @property nothrow
ProgressBar self() nothrowReturns `this`, for use in `with` statements.
ProgressBarGidBuilder builder() static nothrowGet builder for [gtk.progress_bar.ProgressBar] Returns: New builder object
pango.types.EllipsizeMode ellipsize() @property nothrowGet `ellipsize` property. Returns: The preferred place to ellipsize the string, if the progress bar does not have enough room to display the entire string, specified as a #PangoEllipsizeMode.
void ellipsize(pango.types.EllipsizeMode propval) @property nothrowSet `ellipsize` property. Params: propval = The preferred place to ellipsize the string, if the progress bar does not have enough room to display the entire string, specified as a #PangoEllipsizeMode.
double fraction() @property nothrow
void fraction(double propval) @property nothrow
bool inverted() @property nothrow
void inverted(bool propval) @property nothrow
double pulseStep() @property nothrow
void pulseStep(double propval) @property nothrow
bool showText() @property nothrowGet `showText` property. Returns: Sets whether the progress bar will show a text in addition to the bar itself. The shown text is either the value of the #GtkProgressBar:text property or, if that i...
void showText(bool propval) @property nothrowSet `showText` property. Params: propval = Sets whether the progress bar will show a text in addition to the bar itself. The shown text is either the value of the #GtkProgressBar:text property or, ...
string text() @property nothrow
void text(string propval) @property nothrow
pango.types.EllipsizeMode getEllipsize() nothrowReturns the ellipsizing position of the progress bar. See [gtk.progress_bar.ProgressBar.setEllipsize]. Returns: #PangoEllipsizeMode
double getFraction() nothrowReturns the current fraction of the task that’s been completed. Returns: a fraction from 0.0 to 1.0
bool getInverted() nothrowGets the value set by [gtk.progress_bar.ProgressBar.setInverted]. Returns: true if the progress bar is inverted
double getPulseStep() nothrowRetrieves the pulse step set with [gtk.progress_bar.ProgressBar.setPulseStep]. Returns: a fraction from 0.0 to 1.0
bool getShowText() nothrowGets the value of the #GtkProgressBar:show-text property. See [gtk.progress_bar.ProgressBar.setShowText]. Returns: true if text is shown in the progress bar
string getText() nothrowRetrieves the text that is displayed with the progress bar, if any, otherwise null. The return value is a reference to the text, not a copy of it, so will become invalid if you change the text in t...
void pulse() nothrowIndicates 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 [gtk.progress_bar...
void setEllipsize(pango.types.EllipsizeMode mode) nothrowSets the mode used to ellipsize (add an ellipsis: "...") the text if there is not enough space to render the entire string.
void setFraction(double fraction) nothrowCauses the progress bar to “fill in” the given fraction of the bar. The fraction should be between 0.0 and 1.0, inclusive.
void setInverted(bool inverted) nothrowProgress bars normally grow from top to bottom or left to right. Inverted progress bars grow in the opposite direction.
void setPulseStep(double fraction) nothrowSets the fraction of total progress bar length to move the bouncing block for each call to [gtk.progress_bar.ProgressBar.pulse].
void setShowText(bool showText) nothrowSets whether the progress bar will show text next to the bar. The shown text is either the value of the #GtkProgressBar:text property or, if that is null, the #GtkProgressBar:fraction value, as a p...
void setText(string text = null) nothrowCauses the given text to appear next to the progress bar.
Constructors
this(void * ptr, Flag!"Take" take)
this()Creates a new #GtkProgressBar. Returns: a #GtkProgressBar.

Fluent builder implementation template for gtk.progress_bar.ProgressBar

Methods
T ellipsize(pango.types.EllipsizeMode propval) nothrowSet `ellipsize` property. Params: propval = The preferred place to ellipsize the string, if the progress bar does not have enough room to display the entire string, specified as a #PangoEllipsizeMode.
T fraction(double propval) nothrow
T inverted(bool propval) nothrow
T pulseStep(double propval) nothrow
T showText(bool propval) nothrowSet `showText` property. Params: propval = Sets whether the progress bar will show a text in addition to the bar itself. The shown text is either the value of the #GtkProgressBar:text property or, ...
T text(string propval) nothrow

Fluent builder for gtk.progress_bar.ProgressBar

Methods
ProgressBar build() nothrowCreate object from builder. Returns: New object