ProgressBar

Description 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_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 gtk_progress_bar_pulse() perodically 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. Note The GtkProgressBar/GtkProgress API in GTK 1.2 was bloated, needlessly complex and hard to use properly. Therefore GtkProgress has been deprecated completely and the GtkProgressBar API has been reduced to the following 10 functions: gtk_progress_bar_new(), gtk_progress_bar_pulse(), gtk_progress_bar_set_text(), gtk_progress_bar_set_fraction(), gtk_progress_bar_set_pulse_step(), gtk_progress_bar_set_orientation(), gtk_progress_bar_get_text(), gtk_progress_bar_get_fraction(), gtk_progress_bar_get_pulse_step(), gtk_progress_bar_get_orientation(). These have been grouped at the beginning of this section, followed by a large chunk of deprecated 1.2 compatibility functions.

Constructors

this
this(GtkProgressBar* gtkProgressBar)

Sets our main struct and passes it to the parent class

this
this()

Creates a new GtkProgressBar. Creates a new GtkProgressBar.

this
this(Adjustment adjustment)

Warning gtk_progress_bar_new_with_adjustment is deprecated and should not be used in newly-written code. Creates a new GtkProgressBar with an associated GtkAdjustment.

Members

Functions

getEllipsize
PangoEllipsizeMode getEllipsize()

Returns the ellipsizing position of the progressbar. See gtk_progress_bar_set_ellipsize(). Since 2.6

getFraction
double getFraction()

Returns the current fraction of the task that's been completed.

getOrientation
GtkProgressBarOrientation getOrientation()

Retrieves the current progress bar orientation.

getProgressBarStruct
GtkProgressBar* getProgressBarStruct()
Undocumented in source. Be warned that the author may not have intended to support it.
getPulseStep
double getPulseStep()

Retrieves the pulse step set with gtk_progress_bar_set_pulse_step()

getStruct
void* getStruct()

the main Gtk struct as a void*

getText
string getText()

Retrieves the text displayed superimposed on 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 the progress bar.

pulse
void pulse()

Indicates that some progress is 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_pulse() causes the block to move by a little bit (the amount of movement per pulse is determined by gtk_progress_bar_set_pulse_step()).

setActivityBlocks
void setActivityBlocks(uint blocks)

Warning gtk_progress_bar_set_activity_blocks is deprecated and should not be used in newly-written code. Sets the number of blocks used when the progress bar is in activity mode. Larger numbers make the visible block smaller.

setActivityStep
void setActivityStep(uint step)

Warning gtk_progress_bar_set_activity_step is deprecated and should not be used in newly-written code. Sets the step value used when the progress bar is in activity mode. The step is the amount by which the progress is incremented each iteration.

setBarStyle
void setBarStyle(GtkProgressBarStyle style)

Warning gtk_progress_bar_set_bar_style is deprecated and should not be used in newly-written code. Sets the style of the GtkProgressBar. The default style is GTK_PROGRESS_CONTINUOUS.

setDiscreteBlocks
void setDiscreteBlocks(uint blocks)

Warning gtk_progress_bar_set_discrete_blocks is deprecated and should not be used in newly-written code. Sets the number of blocks that the progress bar is divided into when the style is GTK_PROGRESS_DISCRETE.

setEllipsize
void setEllipsize(PangoEllipsizeMode mode)

Sets the mode used to ellipsize (add an ellipsis: "...") the text if there is not enough space to render the entire string. Since 2.6

setFraction
void setFraction(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.

setOrientation
void setOrientation(GtkProgressBarOrientation orientation)

Causes the progress bar to switch to a different orientation (left-to-right, right-to-left, top-to-bottom, or bottom-to-top).

setPulseStep
void setPulseStep(double fraction)

Sets the fraction of total progress bar length to move the bouncing block for each call to gtk_progress_bar_pulse().

setStruct
void setStruct(GObject* obj)
Undocumented in source. Be warned that the author may not have intended to support it.
setText
void setText(string text)

Causes the given text to appear superimposed on the progress bar.

update
void update(double percentage)

Warning gtk_progress_bar_update is deprecated and should not be used in newly-written code. This function is deprecated. Please use gtk_progress_set_value() or gtk_progress_set_percentage() instead.

Variables

gtkProgressBar
GtkProgressBar* gtkProgressBar;

the main Gtk struct

Inherited Members

From Progress

gtkProgress
GtkProgress* gtkProgress;

the main Gtk struct

getProgressStruct
GtkProgress* getProgressStruct()
Undocumented in source. Be warned that the author may not have intended to support it.
getStruct
void* getStruct()

the main Gtk struct as a void*

setStruct
void setStruct(GObject* obj)
Undocumented in source. Be warned that the author may not have intended to support it.
setShowText
void setShowText(int showText)

Warning gtk_progress_set_show_text is deprecated and should not be used in newly-written code. Controls whether progress text is shown.

setTextAlignment
void setTextAlignment(float xAlign, float yAlign)

Warning gtk_progress_set_text_alignment is deprecated and should not be used in newly-written code. Controls the alignment of the text within the progress bar area.

setFormatString
void setFormatString(string format)

Warning gtk_progress_set_format_string is deprecated and should not be used in newly-written code. Sets a format string used to display text indicating the

setAdjustment
void setAdjustment(Adjustment adjustment)

Warning gtk_progress_set_adjustment is deprecated and should not be used in newly-written code. Associates a GtkAdjustment with the GtkProgress. A GtkAdjustment is used to represent the upper and lower bounds and the step interval of the underlying value for which progress is shown.

setPercentage
void setPercentage(double percentage)

Warning gtk_progress_set_percentage is deprecated and should not be used in newly-written code. Sets the current percentage completion for the GtkProgress.

setValue
void setValue(double value)

Warning gtk_progress_set_value is deprecated and should not be used in newly-written code. Sets the value within the GtkProgress to an absolute value. The value must be within the valid range of values for the underlying GtkAdjustment.

getValue
double getValue()

Warning gtk_progress_get_value is deprecated and should not be used in newly-written code. Returns the current progress complete value.

setActivityMode
void setActivityMode(int activityMode)

Warning gtk_progress_set_activity_mode is deprecated and should not be used in newly-written code. A GtkProgress can be in one of two different modes: percentage mode (the default) and activity mode. In activity mode, the progress is simply indicated as activity rather than as a percentage complete.

getCurrentText
string getCurrentText()

Warning gtk_progress_get_current_text is deprecated and should not be used in newly-written code. Returns the current text associated with the GtkProgress. This text is the based on the underlying format string after any substitutions are made.

getTextFromValue
string getTextFromValue(double value)

Warning gtk_progress_get_text_from_value is deprecated and should not be used in newly-written code. Returns the text indicating the progress based on the supplied value. The current value for the GtkProgress remains unchanged.

getCurrentPercentage
double getCurrentPercentage()

Warning gtk_progress_get_current_percentage is deprecated and should not be used in newly-written code. Returns the current progress as a percentage.

getPercentageFromValue
double getPercentageFromValue(double value)

Warning gtk_progress_get_percentage_from_value is deprecated and should not be used in newly-written code. Returns the progress as a percentage calculated from the supplied absolute progress value.

configure
void configure(double value, double min, double max)

Warning gtk_progress_configure is deprecated and should not be used in newly-written code. Allows the configuration of the minimum, maximum, and current values for the GtkProgress.

Meta