Tcl 8.7/Tk8.7a5 Documentation > Tk Commands > ttk_progressbar

Tcl/Tk Applications | Tcl Commands | Tk Commands | Tcl C API | Tk C API

NAME
ttk::progressbar — Provide progress feedback
SYNOPSIS
DESCRIPTION
STANDARD OPTIONS
-anchor, anchor, Anchor
-class, undefined, undefined
-cursor, cursor, Cursor
-font, font, Font
-foreground, textColor, TextColor
-justify, justify, Justify
-style, style, Style
-takefocus, takeFocus, TakeFocus
-text, text, Text
-wraplength, wrapLength, WrapLength
WIDGET-SPECIFIC OPTIONS
-length, length, Length
-maximum, maximum, Maximum
-mode, mode, Mode
-orient, orient, Orient
-phase, phase, Phase
-value, value, Value
-variable, variable, Variable
WIDGET COMMAND
pathName start ?interval?
pathName step ?amount?
pathName stop
STYLING OPTIONS
SEE ALSO

NAME

ttk::progressbar — Provide progress feedback

SYNOPSIS

ttk::progressbar pathName ?options?

DESCRIPTION

A ttk::progressbar widget shows the status of a long-running operation. They can operate in two modes: determinate mode shows the amount completed relative to the total amount of work to be done, and indeterminate mode provides an animated display to let the user know that something is happening.

If the value of -orient is horizontal a text string can be displayed inside the progressbar. This string can be configured using the -anchor, -font, -foreground, -justify, -text and -wraplength options. If the value of -orient is vertical then these options are ignored.

STANDARD OPTIONS

-anchor, anchor, Anchor
-class, undefined, undefined
-cursor, cursor, Cursor
-font, font, Font
-foreground, textColor, TextColor
-justify, justify, Justify
-style, style, Style
-takefocus, takeFocus, TakeFocus
-text, text, Text
-wraplength, wrapLength, WrapLength

WIDGET-SPECIFIC OPTIONS

Command-Line Name: -length
Database Name: length
Database Class: Length
Specifies the length of the long axis of the progress bar (width if horizontal, height if vertical). The value may have any of the forms acceptable to Tk_GetPixels.

Command-Line Name: -maximum
Database Name: maximum
Database Class: Maximum
A floating point number specifying the maximum -value. Defaults to 100.

Command-Line Name: -mode
Database Name: mode
Database Class: Mode
One of determinate or indeterminate.

Command-Line Name: -orient
Database Name: orient
Database Class: Orient
One of horizontal or vertical. Specifies the orientation of the progress bar.

Command-Line Name: -phase
Database Name: phase
Database Class: Phase
Read-only option. The widget periodically increments the value of this option whenever the -value is greater than 0 and, in determinate mode, less than -maximum. This option may be used by the current theme to provide additional animation effects.

Command-Line Name: -value
Database Name: value
Database Class: Value
The current value of the progress bar. In determinate mode, this represents the amount of work completed. In indeterminate mode, it is interpreted modulo -maximum; that is, the progress bar completes one “cycle” when the -value increases by -maximum. If -variable is set to an existing variable, specifying -value has no effect (the variable value takes precedence).

Command-Line Name: -variable
Database Name: variable
Database Class: Variable
The name of a global Tcl variable which is linked to the -value. If specified to an existing variable, the -value of the progress bar is automatically set to the value of the variable whenever the latter is modified.

WIDGET COMMAND

In addition to the standard cget, configure, identify element, instate, state and style commands (see ttk::widget), progressbar widgets support the following additional commands:

pathName start ?interval?
Begin autoincrement mode: schedules a recurring timer event that calls step every interval milliseconds. If omitted, interval defaults to 50 milliseconds (20 steps/second).

pathName step ?amount?
Increments the -value by amount. amount defaults to 1.0 if omitted.

pathName stop
Stop autoincrement mode: cancels any recurring timer event initiated by pathName start.

STYLING OPTIONS

The class name for a ttk::progressbar is TProgressbar.

TProgressbar styling options configurable with ttk::style are:

-background color
-bordercolor color
-darkcolor color
-lightcolor color
-maxphase

For the aqua theme.
-period
For the aqua theme.
-troughcolor color

Some options are only available for specific themes.

See the ttk::style manual page for information on how to configure ttk styles.

SEE ALSO

ttk::widget
Copyright © 2005 Joe English