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!

scroll down automatically when new information appear 1

Status
Not open for further replies.

erixire

Technical User
Jun 4, 2002
72
0
0
CA
Hi everybody,

Is there a way to make the scrollbars gowing down automatically when new information appears in a window? I have a window which provide information to the user, but when the information reach the end of the window, the user has to manually click on the scrollbar to see the new information. So is there a command like "update idletasks" that can do the trick?

I hope I make myself understandable,

Thanks
 
If the window is a text widget named .tw and you want to add some text at the end:
Code:
pack [text .tw -height 4]
set txt "_some_text_1
_some_text_2
_some_text_3
_some_text_4
_some_text_5"
.tw insert end $txt
.tw see end

Good luck

ulis
 
Thanks a lot ulis!!!!

That's the command I was missing: ".tw see end"

Thanks again.
 
I am writing lots of data to a window and I want to know is there any limitation to the size of the data that could be displayed on the window.

Thanks,
Sam
 
I am writing lots of data to a window and I want to know is there any limitation to the size of the data that could be displayed on the window.

Thanks,
Sam
 
I think this limitation is tied to virtual memory and is OS dependant.
Maybe 2Go on Windows and Linux due to hardware limits.

Reading a full file in memory or putting all its lines in a text widget are usual practices of Tclers.
But hogging all the memory can make the OS very unstable and unresponsive.

Good luck

ulis
 
That's right, as far as I know Tcl has no inherent limitation to the amount of text you can display in a text widget. It will be more a matter system response than anything else. Quoting from the text reference:

"Text widgets should run efficiently under a variety of conditions. The text widget uses about 2-3 bytes of main memory for each byte of text, so texts containing a megabyte or more should be practical on most workstations. Text is represented internally with a modified B-tree structure that makes operations relatively efficient even with large texts."

If you think you might be pushing the limits of the text widget, definitely read the "Perfomance Issues" section (the last section) of the text widget reference page. It contains several comments on issues affecting text widget performance.

But more practically, you should consider the usability of a text widget containing an enormous amount of text. As a user, I get irritated if a text widget (or a web page, etc) contains so much information that I can't quickly navigate to the bits that I want to see. Unless you provide some additional navigation aids to a user, I think usability will impose a lower size limit than the text widget's technical capabilites will. - Ken Jones, President
Avia Training and Consulting
866-TCL-HELP (866-825-4357) US Toll free
415-643-8692 Voice
415-643-8697 Fax
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top