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