scrollbar question
- From: "madman" <overlog@xxxxxxxxx>
- Date: 29 Mar 2007 09:12:05 -0700
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
.
- Follow-Ups:
- Re: scrollbar question
- From: madman
- Re: scrollbar question
- From: Uwe Klein
- Re: scrollbar question
- From: Gerald W. Lester
- Re: scrollbar question
- Prev by Date: Re: Problem with if/else
- Next by Date: OPPORTUNITY FOR EXPERT Tcl/Tk DEVELOPER
- Previous by thread: Problem with if/else
- Next by thread: Re: scrollbar question
- Index(es):
Relevant Pages
|