Tcl Tutorial
Tk Tutorial
Tcl/Tk Useful Resources
Selected Reading
- 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 - Basic Widgets
Tk - Basic Widgets
Basic widgets are common widgets available in almost all Tk apppcations. The pst of available basic widgets is given below −
Sr.No. | Widgets & Description |
---|---|
1 | Widget for displaying single pne of text. |
2 | Widget that is cpckable and triggers an action. |
3 | Widget used to accept a single pne of text as input. |
4 | Widget for displaying multiple pnes of text. |
5 | Widget for displaying and optionally edit multiple pnes of text. |
6 | Widget used to create a frame that is a new top level window. |
A simple Tk example is shown below using basic widgets −
#!/usr/bin/wish grid [label .myLabel -text "Label Widget" -textvariable labelText] grid [text .myText -width 20 -height 5] .myText insert 1.0 "Text Widget " grid [entry .myEntry -text "Entry Widget"] grid [message .myMessage -background red -foreground white -text "Message Widget"] grid [button .myButton1 -text "Button" -command "set labelText cpcked"]
When we run the above program, we will get the following output −
Advertisements