|
Panedwindow
The panedwindow iwidget is composed of panes, separators, and sashes for adjustment of the separators. Each pane is a child site and the class provides a command which returns the paths for the sites. The user may fill them with further widget combinations. The Panedwindow offers significant control over its presentation through a large set of options. The option set allows specification of the distance between a pane and its contents, the minimum size a pane's contents may reach, the orientation of separators, the thickness of the separators, as well as the dimensions, position, and cursor associated with the sash.
For further information, see the Panedwindow
manpage
Components: hull
|
wm title . "Panedwindow Example"
wm geometry . 400x200
##
## helper proc to display text
##
proc showText {} {
global cs
set i [$cs(bitmap).slb getcurselection]
$cs(text).st clear
$cs(text).st insert 1.0 "You picked the $i bitmap"
$cs(display).lab configure \
-bitmap $i
return
}; # end proc showText
##=========================================================
## Create a panedwindow iwidget
##=========================================================
##
iwidgets::panedwindow .pw \
-orient vertical \
-sashwidth 25 \
-sashheight 25 \
-showhandle 2
##
## Add the panes
##
foreach p {bitmap text display} {
.pw add $p
set cs($p) [.pw childsite $p]
}
.pw fraction 30 50 20
##
## Add other widgets to the panes
##
iwidgets::scrolledlistbox $cs(bitmap).slb \
-vscrollmode static \
-hscrollmode dynamic \
-labeltext bitmaps \
-selectioncommand {showText}
iwidgets::scrolledtext $cs(text).st \
-vscrollmode static \
-hscrollmode dynamic \
-wrap word \
-labeltext "Description"
label $cs(display).lab
##
## Add some bitmaps into the listbox
##
foreach i {error hourglass question info} {
$cs(bitmap).slb insert end $i
}
pack $cs(bitmap).slb $cs(text).st $cs(display).lab \
-fill both \
-expand 1
pack .pw \
-fill both \
-expand 1
|
Download this sample code |
|