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
<!-- ##### SECTION Image ##### -->
65
<!-- ##### STRUCT GtkProgressBar ##### -->
67
The #GtkProgressBar-struct struct contains private data only,
68
and should be accessed using the functions below.
72
<!-- ##### ARG GtkProgressBar:activity-blocks ##### -->
77
<!-- ##### ARG GtkProgressBar:activity-step ##### -->
82
<!-- ##### ARG GtkProgressBar:adjustment ##### -->
87
<!-- ##### ARG GtkProgressBar:bar-style ##### -->
92
<!-- ##### ARG GtkProgressBar:discrete-blocks ##### -->
97
<!-- ##### ARG GtkProgressBar:ellipsize ##### -->
102
<!-- ##### ARG GtkProgressBar:fraction ##### -->
107
<!-- ##### ARG GtkProgressBar:orientation ##### -->
112
<!-- ##### ARG GtkProgressBar:pulse-step ##### -->
117
<!-- ##### ARG GtkProgressBar:text ##### -->
122
<!-- ##### ARG GtkProgressBar:min-horizontal-bar-height ##### -->
127
<!-- ##### ARG GtkProgressBar:min-horizontal-bar-width ##### -->
132
<!-- ##### ARG GtkProgressBar:min-vertical-bar-height ##### -->
137
<!-- ##### ARG GtkProgressBar:min-vertical-bar-width ##### -->
142
<!-- ##### ARG GtkProgressBar:xspacing ##### -->
147
<!-- ##### ARG GtkProgressBar:yspacing ##### -->
152
<!-- ##### FUNCTION gtk_progress_bar_new ##### -->
154
Creates a new #GtkProgressBar.
158
@Returns: a #GtkProgressBar.
161
<!-- ##### FUNCTION gtk_progress_bar_pulse ##### -->
169
<!-- ##### FUNCTION gtk_progress_bar_set_text ##### -->
178
<!-- ##### FUNCTION gtk_progress_bar_set_fraction ##### -->
187
<!-- ##### FUNCTION gtk_progress_bar_set_pulse_step ##### -->
196
<!-- ##### FUNCTION gtk_progress_bar_set_orientation ##### -->
205
<!-- ##### FUNCTION gtk_progress_bar_set_ellipsize ##### -->
214
<!-- ##### ENUM GtkProgressBarOrientation ##### -->
216
An enumeration representing possible orientations and growth
217
directions for the visible progress bar.
220
@GTK_PROGRESS_LEFT_TO_RIGHT: A horizontal progress bar growing from left to right.
221
@GTK_PROGRESS_RIGHT_TO_LEFT: A horizontal progress bar growing from right to left.
222
@GTK_PROGRESS_BOTTOM_TO_TOP: A vertical progress bar growing from bottom to top.
223
@GTK_PROGRESS_TOP_TO_BOTTOM: A vertical progress bar growing from top to bottom.
225
<!-- ##### FUNCTION gtk_progress_bar_get_text ##### -->
234
<!-- ##### FUNCTION gtk_progress_bar_get_fraction ##### -->
243
<!-- ##### FUNCTION gtk_progress_bar_get_pulse_step ##### -->
252
<!-- ##### FUNCTION gtk_progress_bar_get_orientation ##### -->
261
<!-- ##### FUNCTION gtk_progress_bar_get_ellipsize ##### -->
270
<!-- ##### FUNCTION gtk_progress_bar_new_with_adjustment ##### -->
277
<!-- ##### FUNCTION gtk_progress_bar_set_bar_style ##### -->
279
Sets the style of the #GtkProgressBar. The default style is
280
%GTK_PROGRESS_CONTINUOUS.
283
@pbar: a #GtkProgressBar.
284
@style: a #GtkProgressBarStyle value indicating the desired style.
287
<!-- ##### ENUM GtkProgressBarStyle ##### -->
289
An enumeration representing the styles for drawing the progress bar.
292
@GTK_PROGRESS_CONTINUOUS: The progress bar grows in a smooth, continuous manner.
293
@GTK_PROGRESS_DISCRETE: The progress bar grows in discrete, visible blocks.
295
<!-- ##### FUNCTION gtk_progress_bar_set_discrete_blocks ##### -->
297
Sets the number of blocks that the progress bar is divided into
298
when the style is %GTK_PROGRESS_DISCRETE.
301
@pbar: a #GtkProgressBar.
302
@blocks: number of individual blocks making up the bar.
305
<!-- ##### FUNCTION gtk_progress_bar_set_activity_step ##### -->
307
Sets the step value used when the progress bar is in activity
308
mode. The step is the amount by which the progress is incremented
312
@pbar: a #GtkProgressBar.
313
@step: the amount which the progress is incremented in activity
317
<!-- ##### FUNCTION gtk_progress_bar_set_activity_blocks ##### -->
319
Sets the number of blocks used when the progress bar is in activity
320
mode. Larger numbers make the visible block smaller.
323
@pbar: a #GtkProgressBar.
324
@blocks: number of blocks which can fit within the progress bar area.
327
<!-- ##### FUNCTION gtk_progress_bar_update ##### -->
329
This function is deprecated. Please use gtk_progress_set_value() or
330
gtk_progress_set_percentage() instead.
333
@pbar: a #GtkProgressBar.
334
@percentage: the new percent complete value.