Q:

How to make a TableList scrollable in tcl?

I'm using the tablelist package to show a table list (heh) in a frame, but the frame is quite small and there is a bunch of columns in the table.
I need some way to make this tablelist scrollable both horizontally and vertically.
Here is the code of my tablelist
labelframe .t.lbf -text "Search Results for: $term" -padx 0 -width 47

tablelist::tablelist .t.mlb -selectmode multiple -columns {0 "File" 0 "Name" 0 "Version" 0 "Archtectures" 0 "Summary" 0 "Type"} -stretch all -background white -width 47                

pack .t.mlb  -in .t.lbf -anchor w

place .t.lbf -x 10 -y 125

A:

I've posted the basic recipe for adding scrollbars to a widget (in this case a text widget) here. The following seems to work:
toplevel .t
labelframe .t.lbf -text "Search Results for: $term" -padx 0 -width 47
tablelist::tablelist .t.lbf.mlb -selectmode multiple -columns {0 "File" 0 "Name" 0 "Version" 0 "Archtectures" 0 "Summary" 0 "Type"} -stretch all -background white -width 47 -xscroll {.t.lbf.h set} -yscroll {.t.lbf.v set}

scrollbar .t.lbf.v -orient vertical   -command {.t.lbf.mlb yview}
scrollbar .t.lbf.h -orient horizontal -command {.t.lbf.mlb xview}

# Lay them out
grid .t.lbf -sticky nsew

grid .t.lbf.mlb .t.lbf.v -sticky nsew
grid .t.lbf.h            -sticky nsew

# Tell the tablelist widget to take all the extra room
grid rowconfigure    .t.lbf .t.lbf.mlb -weight 1
grid columnconfigure .t.lbf .t.lbf.mlb -weight 1

place .t.lbf -x 10 -y 125

Note to other readers: the OP wanted to wrap the tablelist in a labelframe and then place that. Without those requirements, the task gets somewhat easier. Again, see my example in the link above: reusing it for a table list only involves replacing the text widget.
Documentation: grid, labelframe, place, scrollbar, toplevel

