Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Scrollbar problem

Status
Not open for further replies.

reggler

Programmer
Nov 13, 2008
63
CA
Hi,

I'm a TCL beginner and I have problems adding scroll bars to a listbox. So I have tried to make a small example script to put two scrollbars on a text box like this:
[tt]scrollbar .yscroll -command {.two.text yview} -orient vertical
scrollbar .xscroll -command {.two.text xview} -orient horizontal
text .two.text -yscrollcommand {.yscroll set}\
-xscrollcommand {.xscroll set}
pack .two.text -side top[/tt]

Why does this not give me scrollbars to scroll the text box??? :eek:

Thank you for any help or assistance!
 
Well yes, actually I got the scrollbar displayed in my list box now but at the wrong position. :(
I got this now:
[tt]
listbox .operatorWindow.operatorList \
-background white -font {arial 11 normal} \
-selectmode browse -listvariable finaltest::eek:peratorList \
-yscrollcommand {.operatorWindow.yscroll set}
scrollbar .operatorWindow.yscroll -command {.operatorWindow.operatorList yview} -orient vertical
[/tt]

and then:

[tt]
place .operatorWindow.operatorList \
-x 31 -y 90 -width 150 -height 146 -anchor nw -bordermode ignore
grid .operatorWindow.yscroll -in .operatorWindow.operatorList -column 2 -sticky NS
[/tt]

shouldn't this make it be aligned on the right side of the listbox along the whole height?
instead it shows up in the centre of the listbox :(
 
I always get screwy results when I mix geometry managers (as you are doing with place and grid). Also I get better results with pack.

Code:
pack .operatorWindow.operatorList -side left
pack .operatorWindow.yscroll -side right -fill y

_________________
Bob Rashkin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top