Home › Tk Themed Widget Tk
ttk::progressbar
Provide progress feedback
literal type exactly as shown
argument replace with your value
?optional? may be omitted
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 | -class | -cursor | |
| -font | -foreground | -justify | -style |
| -takefocus | -text | -wraplength |
See the ttk_widget manual entry for details on the standard options.
Widget-specific options#
-length#-
Database name lengthDatabase class LengthSpecifies 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. -maximum#-
Database name maximumDatabase class MaximumA floating point number specifying the maximum
-value. Defaults to 100. -mode#-
Database name modeDatabase class ModeOne of
determinateorindeterminate. -orient#-
Database name orientDatabase class OrientOne of
horizontalorvertical. Specifies the orientation of the progress bar. -phase#-
Database name phaseDatabase class PhaseRead-only option. The widget periodically increments the value of this option whenever the
-valueis greater than 0 and, in determinate mode, less than-maximum. This option may be used by the current theme to provide additional animation effects. -value#-
Database name valueDatabase class ValueThe 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-valueincreases by-maximum. If-variableis set to an existing variable, specifying-valuehas no effect (the variable value takes precedence). -variable#-
Database name variableDatabase class VariableThe name of a global Tcl variable which is linked to the
-value. If specified to an existing variable, the-valueof 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
stepevery interval milliseconds. If omitted, interval defaults to 50 milliseconds (20 steps/second). - pathName
step?amount? -
Increments the
-valueby 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.
Copyright#
- Copyright © 2005 Joe English