1
<!-- ##### SECTION Title ##### -->
4
<!-- ##### SECTION Short_Description ##### -->
5
A widget which indicates progress visually
7
<!-- ##### SECTION Long_Description ##### -->
9
The #GtkProgressBar is typically used to display the progress of a long
10
running operation. It provides a visual clue that processing
11
is underway. The #GtkProgressBar can be used in two different
12
modes: percentage mode and activity mode.
16
When an application can determine how much work needs to take place
17
(e.g. read a fixed number of bytes from a file) and can monitor its
18
progress, it can use the #GtkProgressBar in percentage mode and the user
19
sees a growing bar indicating the percentage of the work that has
20
been completed. In this mode, the application is required to call
21
gtk_progress_bar_set_fraction() periodically to update the progress bar.
25
When an application has no accurate way of knowing the amount of work
26
to do, it can use the #GtkProgressBar in activity mode, which shows activity
27
by a block moving back and forth within the progress area. In this mode,
28
the application is required to call gtk_progress_bar_pulse() perodically
29
to update the progress bar.
33
There is quite a bit of flexibility provided to control the appearance
34
of the #GtkProgressBar. Functions are provided to control the
35
orientation of the bar, optional text can be displayed along with
36
the bar, and the step size used in activity mode can be set.
41
The #GtkProgressBar/#GtkProgress API in GTK 1.2 was bloated, needlessly complex
42
and hard to use properly. Therefore #GtkProgress has been deprecated
43
completely and the #GtkProgressBar API has been reduced to the following 10
44
functions: gtk_progress_bar_new(), gtk_progress_bar_pulse(),
45
gtk_progress_bar_set_text(), gtk_progress_bar_set_fraction(),
46
gtk_progress_bar_set_pulse_step(), gtk_progress_bar_set_orientation(),
47
gtk_progress_bar_get_text(), gtk_progress_bar_get_fraction(),
48
gtk_progress_bar_get_pulse_step(), gtk_progress_bar_get_orientation().
49
These have been grouped at the beginning of this section, followed by
50
a large chunk of deprecated 1.2 compatibility functions.
54
<!-- ##### SECTION See_Also ##### -->
59
<!-- ##### SECTION Stability_Level ##### -->
62
<!-- ##### STRUCT GtkProgressBar ##### -->
64
The #GtkProgressBar-struct struct contains private data only,
65
and should be accessed using the functions below.
69
<!-- ##### ARG GtkProgressBar:activity-blocks ##### -->
74
<!-- ##### ARG GtkProgressBar:activity-step ##### -->
79
<!-- ##### ARG GtkProgressBar:adjustment ##### -->
84
<!-- ##### ARG GtkProgressBar:bar-style ##### -->
89
<!-- ##### ARG GtkProgressBar:discrete-blocks ##### -->
94
<!-- ##### ARG GtkProgressBar:ellipsize ##### -->
99
<!-- ##### ARG GtkProgressBar:fraction ##### -->
104
<!-- ##### ARG GtkProgressBar:orientation ##### -->
109
<!-- ##### ARG GtkProgressBar:pulse-step ##### -->
114
<!-- ##### ARG GtkProgressBar:text ##### -->
119
<!-- ##### FUNCTION gtk_progress_bar_new ##### -->
121
Creates a new #GtkProgressBar.
124
@Returns: a #GtkProgressBar.
127
<!-- ##### FUNCTION gtk_progress_bar_pulse ##### -->
135
<!-- ##### FUNCTION gtk_progress_bar_set_text ##### -->
144
<!-- ##### FUNCTION gtk_progress_bar_set_fraction ##### -->
153
<!-- ##### FUNCTION gtk_progress_bar_set_pulse_step ##### -->
162
<!-- ##### FUNCTION gtk_progress_bar_set_orientation ##### -->
171
<!-- ##### FUNCTION gtk_progress_bar_set_ellipsize ##### -->
180
<!-- ##### ENUM GtkProgressBarOrientation ##### -->
182
An enumeration representing possible orientations and growth
183
directions for the visible progress bar.
186
@GTK_PROGRESS_LEFT_TO_RIGHT: A horizontal progress bar growing from left to right.
187
@GTK_PROGRESS_RIGHT_TO_LEFT: A horizontal progress bar growing from right to left.
188
@GTK_PROGRESS_BOTTOM_TO_TOP: A vertical progress bar growing from bottom to top.
189
@GTK_PROGRESS_TOP_TO_BOTTOM: A vertical progress bar growing from top to bottom.
191
<!-- ##### FUNCTION gtk_progress_bar_get_text ##### -->
200
<!-- ##### FUNCTION gtk_progress_bar_get_fraction ##### -->
209
<!-- ##### FUNCTION gtk_progress_bar_get_pulse_step ##### -->
218
<!-- ##### FUNCTION gtk_progress_bar_get_orientation ##### -->
227
<!-- ##### FUNCTION gtk_progress_bar_get_ellipsize ##### -->
236
<!-- ##### FUNCTION gtk_progress_bar_new_with_adjustment ##### -->
238
Creates a new #GtkProgressBar with an associated #GtkAdjustment.
241
@adjustment: a #GtkAdjustment.
242
@Returns: a #GtkProgressBar.
245
<!-- ##### FUNCTION gtk_progress_bar_set_bar_style ##### -->
247
Sets the style of the #GtkProgressBar. The default style is
248
%GTK_PROGRESS_CONTINUOUS.
251
@pbar: a #GtkProgressBar.
252
@style: a #GtkProgressBarStyle value indicating the desired style.
255
<!-- ##### ENUM GtkProgressBarStyle ##### -->
257
An enumeration representing the styles for drawing the progress bar.
260
@GTK_PROGRESS_CONTINUOUS: The progress bar grows in a smooth, continuous manner.
261
@GTK_PROGRESS_DISCRETE: The progress bar grows in discrete, visible blocks.
263
<!-- ##### FUNCTION gtk_progress_bar_set_discrete_blocks ##### -->
265
Sets the number of blocks that the progress bar is divided into
266
when the style is %GTK_PROGRESS_DISCRETE.
269
@pbar: a #GtkProgressBar.
270
@blocks: number of individual blocks making up the bar.
273
<!-- ##### FUNCTION gtk_progress_bar_set_activity_step ##### -->
275
Sets the step value used when the progress bar is in activity
276
mode. The step is the amount by which the progress is incremented
280
@pbar: a #GtkProgressBar.
281
@step: the amount which the progress is incremented in activity
285
<!-- ##### FUNCTION gtk_progress_bar_set_activity_blocks ##### -->
287
Sets the number of blocks used when the progress bar is in activity
288
mode. Larger numbers make the visible block smaller.
291
@pbar: a #GtkProgressBar.
292
@blocks: number of blocks which can fit within the progress bar area.
295
<!-- ##### FUNCTION gtk_progress_bar_update ##### -->
297
This function is deprecated. Please use gtk_progress_set_value() or
298
gtk_progress_set_percentage() instead.
301
@pbar: a #GtkProgressBar.
302
@percentage: the new percent complete value.