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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

scrollbar binding to text

Status
Not open for further replies.

colorblinman

Programmer
Aug 14, 2002
7
0
0
US
Help !!!
I have a text widget binding to a scrollbar. I can not set the height and width
of the text widget in pack command. The text space is too small for viewing.

frame .f1
text .f1.text -yscrollbarcommand ".f1.text.scroll set" -height 50 -width 50
scrollbar .f1.text.scroll -command "f1.text. yview"
pack .f1.text .f.text.scroll -side right -fill x
pack .f1

thanks,

 
The code without the bugs:
Code:
        frame .f1
        text .f1.text -yscrollcommand ".f1.scroll set" -height 20 -width 50
        scrollbar .f1.scroll -command "f1.text. yview"
        pack .f1.text .f1.scroll -side right -fill y
        pack .f1

The text and the scrollbar widgets are children of the frame (the scrollbar is not drawn upon the text but beside).
The text option is -yscrollcommand.

ulis
 
thanks for the help,
Your code works. For some reason, I thought that I have to bind the text to the scrollbar in order the scroll to work.



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top