home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Practical Programming in Tcl & Tk (4th Edition)
/
TCLBOOK4.BIN
/
pc
/
exsource.old
/
31_3.tcl
< prev
next >
Wrap
Text File
|
2003-04-15
|
626b
|
25 lines
#
# Example 31-3
# Listbox with optional scrollbars.
#
proc Scrolled_Listbox { f args } {
frame $f
listbox $f.list \
-xscrollcommand [list Scroll_Set $f.xscroll \
[list grid $f.xscroll -row 1 -column 0 -sticky we]] \
-yscrollcommand [list Scroll_Set $f.yscroll \
[list grid $f.yscroll -row 0 -column 1 -sticky ns]]
eval {$f.list configure} $args
scrollbar $f.xscroll -orient horizontal \
-command [list $f.list xview]
scrollbar $f.yscroll -orient vertical \
-command [list $f.list yview]
grid $f.list -sticky news
grid rowconfigure $f 0 -weight 1
grid columnconfigure $f 0 -weight 1
return $f.list
}