- 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 - Place Widget
The place widget is used to locate a widget at an absolute location or a relative location based on the size of the window. The syntax for place widget is shown below −
place placeName options
Options
The options available for the place widget are listed below in table −
Sr.No. | Syntax & Description |
---|---|
1 | -x xLocation Sets the absolute x position for widget. |
2 | -y yLocation Sets the absolute y position for widget. |
3 | -relx xFraction Sets the relative x position as fraction of width for widget. |
4 | -rely yFraction Sets the relative y position as fraction of height for widget. |
A simple example for place widget is shown below −
#!/usr/bin/wish . configure -width 250 -height 300 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 place .myFrame1 -x 0 -y 20 place .myFrame2 -x 50 -y 150
When we run the above program, we will get the following output −
tk_layout_widgets.htm
Advertisements