1
2@c %start of fragment
3
4@node GtkProgressBar
5@chapter GtkProgressBar
6A widget which indicates progress visually
7
8@section Overview
9The @code{<gtk-progress-bar>} is typically used to display the progress of a
10long running operation. It provides a visual clue that processing is underway.
11The @code{<gtk-progress-bar>} can be used in two different modes: percentage
12mode and activity mode.
13
14When an application can determine how much work needs to take place (e.g. read a
15fixed number of bytes from a file) and can monitor its progress, it can use the
16@code{<gtk-progress-bar>} in percentage mode and the user sees a growing bar
17indicating the percentage of the work that has been completed. In this mode, the
18application is required to call @code{gtk-progress-bar-set-fraction}
19periodically to update the progress bar.
20
21When an application has no accurate way of knowing the amount of work to do, it
22can use the @code{<gtk-progress-bar>} in activity mode, which shows activity by
23a block moving back and forth within the progress area. In this mode, the
24application is required to call @code{gtk-progress-bar-pulse} perodically to
25update the progress bar.
26
27There is quite a bit of flexibility provided to control the appearance of the
28@code{<gtk-progress-bar>}. Functions are provided to control the orientation of
29the bar, optional text can be displayed along with the bar, and the step size
30used in activity mode can be set.
31
32The @code{<gtk-progress-bar>}/@code{<gtk-progress>} API in GTK 1.2 was bloated,
33needlessly complex and hard to use properly. Therefore @code{<gtk-progress>} has
34been deprecated completely and the @code{<gtk-progress-bar>} API has been
35reduced to the following 10 functions: @code{gtk-progress-bar-new},
36@code{gtk-progress-bar-pulse}, @code{gtk-progress-bar-set-text},
37@code{gtk-progress-bar-set-fraction}, @code{gtk-progress-bar-set-pulse-step},
38@code{gtk-progress-bar-set-orientation}, @code{gtk-progress-bar-get-text},
39@code{gtk-progress-bar-get-fraction}, @code{gtk-progress-bar-get-pulse-step},
40@code{gtk-progress-bar-get-orientation}. These have been grouped at the
41beginning of this section, followed by a large chunk of deprecated 1.2
42compatibility functions.
43
44@section Usage
45@include defuns-gtkprogressbar.xml.texi
46
47@c %end of fragment
48