|
Scrolledframe
The scrolledframe iwidget combines the functionality of scrolling with that of a typical frame widget to implement a clipable viewing area whose visible region may be modified with the scrollbars. This enables the construction of visually larger areas than which could normally be displayed, containing a heterogenous mix of widgets. Once created, the Scrolledframe child site can be accessed and filled with widgets.
For further information, see the Scrolledframe
manpage
Components: canvas clipper horizsb hull label vertsb
|
wm title . "Scrolledframe Example"
##=========================================================
## Create a scrolleframe
##=========================================================
##
iwidgets::scrolledframe .sf \
-width 280 \
-height 150 \
-vscrollmode static \
-hscrollmode dynamic \
-borderwidth 1
pack .sf \
-expand 1 \
-fill both
##
## Add some widgets to the
## scrolled region
##
set cs [.sf childsite]
set items [list first_name last_name street city state country home_phone cell_phone]
foreach i $items {
iwidgets::entryfield $cs.$i \
-labeltext [string map {_ " "} $i] \
-width 20
pack $cs.$i
lappend aw $cs.$i
}; # end foreach item
##
## Align labels
##
eval iwidgets::Labeledwidget::alignlabels $aw
##
## Go to last entry and focus
##
focus [$cs.$i component entry]
.sf justify bottom
|
Download this sample code |
|