scrollbar question



I'm a self-proclaimed "intermediate" level tcl programmer and I'm
having problems displaying data in a scrolling window. Basically, I
want to display some data (rows and columns) in a window that can be
scrolled. My idea was to insert a grid frame inside a textbox with a
scrollbar attached. My problem is that although the scrollbar appears,
it doesn't "scroll". Can anybody help me?? Below is a sample code:

toplevel .manBox
wm geometry .manBox +300+5

scrollbar .manBox.scroll -command ".manBox.view yview"
text .manBox.view -yscrollcommand ".manBox.scroll set"
frame .manBox.view.grid

set c1_result 1.0
set c2_result 2.0
set c3_result 3.0

set c1 [label .manBox.view.grid.c1_0 -text "Port #"]
set c2 [label .manBox.view.grid.c2_0 -text "Diff #"]
set c3 [label .manBox.view.grid.c3_0 -text "Port E"]

grid $c1 -row 0 -column 1
grid $c2 -row 0 -column 2
grid $c3 -row 0 -column 3

for {set i 1} {$i <= 25} {incr i} {

set c1 [label .manBox.view.grid.c1_$i -textvariable c1_result]
set c2 [label .manBox.view.grid.c2_$i -textvariable c2_result]
set c3 [label .manBox.view.grid.c3_$i -textvariable c3_result]

grid $c1 -row $i -column 1
grid $c2 -row $i -column 2
grid $c3 -row $i -column 3
}

pack .manBox.scroll -side right -fill y
pack .manBox.view
grid .manBox.view.grid -in .manBox.view
..manBox.view configure -state disable

.



Relevant Pages

  • Re: usage of checkbutton
    ... packing did not happen correctly. ... I did take the pack from my original code and only issue is it is more ... scrollbar for this? ... You might want to consider other alternatives, like a wizard-like interface or notebook tabs. ...
    (comp.lang.tcl)
  • Re: Problem of widget in canvas with scrollbar
    ... but while I scroll scrollbar, the widget's position cann't move, ... don't use place (or pack or grid) to add windows ... to the canvas - usethe canvas command to create a window ... the window item is not a child of the canvas so the clipping ...
    (comp.lang.tcl)
  • Re: Tk horizontal scrollbar infinite loop
    ... On Fri, 24 Feb 2006, Hidetoshi NAGAI wrote: ... Tk horizontal scrollbar infinite loop ... Namely, when run, I see my window and scrollbar flicker rapidly, ... pack .f.sb ...
    (comp.lang.ruby)
  • Re: Scrollbars on WinXP.
    ... pack .s -fill both -expan true ... creates a xp-style scrollbar when executed on wish. ... executed on my application (which embeds tcl/tk), ...
    (comp.lang.tcl)
  • Re: scrollbar question
    ... My idea was to insert a grid frame inside a textbox with a ... My problem is that although the scrollbar appears, ... pack .manBox.scroll -side right -fill y ... grid .manBox.view.grid -in .manBox.view ...
    (comp.lang.tcl)