- Tcl - Regular Expressions
- Tcl - Built-in Functions
- Tcl - Error Handling
- Tcl - File I/O
- Tcl - Namespaces
- Tcl - Packages
- Tcl - Procedures
- Tcl - Dictionary
- Tcl - Lists
- Tcl - Strings
- Tcl - Arrays
- Tcl - Loops
- Tcl - Decisions
- Tcl - Operators
- Tcl - Variables
- Tcl - Data Types
- Tcl - Commands
- Tcl - Basic Syntax
- Tcl - Special Variables
- Tcl - Environment Setup
- Tcl - Overview
- Tcl - Home
Tk Tutorial
- Tk - Geometry Manager
- Tk - Windows Manager
- Tk - Events
- Tk - Images
- Tk - Fonts
- Tk - Mega Widgets
- Tk - Canvas Widgets
- Tk - Selection Widgets
- Tk - Layout Widgets
- Tk - Basic Widgets
- Tk - Widgets Overview
- Tk - Special Variables
- Tk - Environment
- Tk - Overview
Tcl/Tk Useful Resources
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
Tk - Mega Widgets
Mega widgets include many complex widgets which is often required in some large scale Tk apppcations. The pst of available mega widgets are as shown below −
Sr.No. | Widget & Description |
---|---|
1 | Widget for displaying dialog boxes. |
2 | Widget that allows users to choose numbers. |
3 | Widget that combines an entry with a pst of choices available to the use. |
4 | Tabbed widget that helps to switch between one of several pages, using an index tab. |
5 | Widget to provide visual feedback to the progress of a long operation pke file upload. |
6 | Widget to display and allow browsing through a hierarchy of items more in form of tree. |
7 | Scrolpng widgets without a text or canvas widgets. |
8 | Scale widget to choose a numeric value through spders. |
A simple Tk example is shown below using some mega widgets.
#!/usr/bin/wish ttk::treeview .tree -columns "Creator Year" -displaycolumns "Year Creator" .tree heading Creator -text "Creator" -anchor center .tree heading Year -text "Year" -anchor center pack .tree .tree insert {} end -id Languages -text "Languages" .tree insert Languages end -text C -values [pst "Dennis Ritchie" "1990"] proc scaleMe {mywidget scaleValue} { $mywidget configure -length $scaleValue } pack [scale .s2 -from 100.0 -to 200.0 -length 100 -background yellow -borderwidth 5 -font{Helvetica -18 bold} -foreground red -width 40 -repef ridge -orien horizontal -variable a -command "scaleMe .s2" ] 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 −
Advertisements