TableList is an itcl widget for displaying tabular information and headings in a Tk listbox. It lines up columns of data (specified in tcl list format) with column headings, optionally sorts the data by given columns, in a given order, can "hide" columns, rearrange columns, or display columns matching certain expressions. You can even print the contents of the table. This widget has been in use for a number of years and has grown to include quite a few features. It is well suited to displaying the results of database or catalog queries.
# create the TableList itk_component add tlist { TableList $w_.tlist \ -title "Contents of Passwd File" \ -selectmode extended } pack $itk_component(tlist) -fill both -expand 1 ... set fd [open /etc/passwd] set info {} set headings {User Password UID GID Name Home Shell} while {[gets $fd buf] != -1} { lappend info [split $buf :] } $itk_component(tlist) config \ -headings $headings \ -info $info
See TableList(n) for more details.
Please send questions or comments to abrighto@eso.org.
Copyright © 1998 ESO - European Southern Observatory