The [progressBar] command lets you interact with the progress bar located at the right of the global status bar. It is possible to show or hide this progress bar, and modify some of its attributes. By default, the progress bar is invisible. Progress indicators inform users about the status of lengthy operations.
There are three types of progress indicators:



The [progressBar] command implements the first two types of indicators by displaying a progress bar in the global status bar. Version 8.1 of AlphaX also introduces a per-window small asynchronous progress indicator located in the bottom right corner of the message bar (see the [setWinInfo] command with the "busy" property).
Note that if an indeterminate process reaches a point where its duration can be determined, one can easily switch to a determinate progress indicator.
The formal syntax of the [progressBar] command is:
progressBar subcommand ?options?
The possible subcommands are described below. Depending on the subcommand, various options can be additionnally specified.
There are two forms for the syntax of this subcommand:
progressBar configure option progressBar configure option value ?option value...?
The first form returns the value of the option specified as the third argument. The second form lets you set the value of different options.
Here is the description of the currently available options:
Caution: swtiching to indeterminate automatically resets the value of the -label option to 0. So, the following two instructions are not equivalent:
progressBar configure -determinate 1 -label 1 progressBar configure -label 1 -determinate 1
Actually, the second one will result in the -label option to have value 0 since the arguments are parsed from left to right.
This command lets you hide the progress bar. The syntax is simply:
progressBar hide
This subcommand is the opposite of the [hide] subcommand. It lets you display the progress bar if it is hidden.
progressBar show
Here are a few basic examples which can be executed from the Tcl shell in AlphaX:
progressBar show progressBar hide progressBar configure -determinate progressBar configure -determinate 0 progressBar configure -determinate 1 progressBar configure -label progressBar configure -label 0 progressBar configure -label 1 progressBar configure -value progressBar configure -value 25
Here is a small code snippet demonstrating how to use the progress bar during a lengthy operation;
progressBar configure -determinate 1 -label 1
progressBar show
for {set i 0} {$i <= 100} {incr i} {
progressBar configure -value $i
# do some action here
}
progressBar hide
(add your comments here...)
bd In some cases, it may be sufficient to display an asynchronous progress indicator at the document level. The ProgressIndicators page explains how to do that.