Version 0 of Minimal scrolling table with column headers

Updated 2006-01-08 13:57:46

# Supply comments and screenshot soon.

toplevel .pop1 raise .pop1 wm withdraw .

package require Tktable

proc make_scrollable_table {parent variable_name} {

    set table $parent.table
    set xscroll $parent.xscroll
    set yscroll $parent.yscroll
    table $table -rows 100 -height 10 -width 25 \
            -xscrollcommand [list $xscroll set] \
            -yscrollcommand [list $yscroll set] \
            -maxwidth 200 -colwidth 9 \
            -variable $variable_name -titlerows 1
    scrollbar $xscroll -command [list $table xview] -orient horizontal
    scrollbar $yscroll -command [list $table yview]
    pack $xscroll -side bottom -fill x
    pack $yscroll -side right -fill y
    pack $table -side right -fill both -expand 1
    return $table

}

make_scrollable_table .pop1 my_table for {set i 0} {$i < 32} {incr i} {

    for {set j 0} {$j < 10} {incr j} {
        if $i {
            set my_table($i,$j) [expr $i - 1]$j
        } else {
            set my_table($i,$j) Heading$j
        }
    }

}