- Tcl Tutorial
- Tcl - Home
- Tcl - Overview
- Tcl - Environment Setup
- Tcl - Special Variables
- Tcl - Basic Syntax
- Tcl - Commands
- Tcl - Data Types
- Tcl - Variables
- Tcl - Operators
- Tcl - Decisions
- Tcl - Loops
- Tcl - Arrays
- Tcl - Strings
- Tcl - Lists
- Tcl - Dictionary
- Tcl - Procedures
- Tcl - Packages
- Tcl - Namespaces
- Tcl - File I/O
- Tcl - Error Handling
- Tcl - Built-in Functions
- Tcl - Regular Expressions
- Tk Tutorial
- Tk - Overview
- Tk - Environment
- Tk - Special Variables
- Tk - Widgets Overview
- Tk - Basic Widgets
- Tk - Layout Widgets
- Tk - Selection Widgets
- Tk - Canvas Widgets
- Tk - Mega Widgets
- Tk - Fonts
- Tk - Images
- Tk - Events
- Tk - Windows Manager
- Tk - Geometry Manager
- Tcl/Tk Useful Resources
- Tcl/Tk - Quick Guide
- Tcl/Tk - Useful Resources
- Tcl/Tk - Discussion
Tk - Progressbar Widget
Progressbar widget is used to provide visual feedback of the progress of a long operation like file upload. The syntax for progressbar widget is shown below −
progressbar progressbarName options
Options
The options available to progressbar widget is listed below in the following table −
Sr.No. | Syntax & Description |
---|---|
1 | -length number Sets the length for widget. |
2 | -maximum number Set the maximum possible -value. Default is 100. |
3 | -mode mode Mode can be indeterminate or determinate. |
4 | -orien orientation Sets the orientation for widget. It can be either horizontal or vertical. |
5 | -value number The current progress of the progress bar. |
6 | -variable varName Variable associated with the widget. When the text of widget changes, the variable is set to text of widget. |
A simple example for progressbar widget is shown below.
#!/usr/bin/wish pack [ttk::progressbar .p1 -orient horizontal -length 200 -mode indeterminate -value 90] pack [ttk::progressbar .p2 -orient horizontal -length 200 -mode determinate -variable a -maximum 75 -value 20]
When we run the above program, we will get the following output.