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!

Scrollable window?

Status
Not open for further replies.

rameshbhats

Technical User
Dec 7, 2010
8
GB
Hi All,

I am failrly new to TCL/TK. But I am trying something like this:
I have a file with following data:
John
David
Ken
Henry

I want to read above file & create label, entry widgets like in following way against each name mentioned in above file:
Name:<show name using label widget> Past experience:<Entry form using entry widget>

Finally a button widget to save all the entry entered.

I am trying in following way:
Read the file, & store names in a list
& using for loop, first create a frame, then create label, entry widget & pack in the frame

So there will be one frame per name.

The above way of impelementation worked so far.

But when the number of names increased, the window hieght is long & I am not able to see all the names. So I thought of putting scolling facility But so far I am not able to find(understood) a easy way. Can any body please suggest?

Thanks in advance
Ramesh















 
In just straight Tk, there is no scrollable window. I use a textbox, with scrollbars, and put everything inside that. Alternatively, the Bwidgets package has both a "scrollableFrame" and a "scrolledWindow" widget.

_________________
Bob Rashkin
 
Hi Bong,

Thans for reply, can I put widgets like label & entry inside textbox?

Regards
Ramesh
 
Yes, you can. If you loaded Tcl from ActiveState (maybe otherwise, too) you should have the Tk Demos. The one called "A text widget with embedded windows and other features" shows this nicely. The basic idea is that once the text widget is packed, it's essentially just like a frame.

_________________
Bob Rashkin
 
Thanks for the information. I will try to understand it and come back
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top