- 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 - Frame Widget
The frame widget is a rectangular container widget that groups widgets for designing GUI. The syntax for frame widget is shown below −
frame frameName options
Options
The options available for the frame widget are listed below in table −
Sr.No. | Syntax & Description |
---|---|
1 | -background color Used to set background color for widget. |
2 | -borderwidth width Used to draw with border in 3D effects. |
3 | -height number Used to set height for widget. |
4 | -padx number Sets the padx for the widget. |
5 | -pady number Sets the pady for the widget. |
6 | -relief condition Sets the 3D relief for this widget. The condition may be raised, sunken, flat, ridge, solid, or groove. |
7 | -width number Sets the width for widget. |
A simple example for frame widget is shown below −
#!/usr/bin/wish frame .myFrame1 -background red -relief ridge -borderwidth 8 -padx 10 -pady 10 -height 100 -width 100 frame .myFrame2 -background blue -relief ridge -borderwidth 8 -padx 10 -pady 10 -height 100 -width 50 pack .myFrame1 pack .myFrame2
When we run the above program, we will get the following output −
tk_layout_widgets.htm
Advertisements