Training, Open Source computer languages

This is page http://www.wellho.net/forum/The-Tcl- ... guage/globally-refresh-text-related-widgets.html

Our email: info@wellho.net • Phone: 01144 1225 708225

 
For 2023 (and 2024 ...) - we are now fully retired from IT training.
We have made many, many friends over 25 years of teaching about Python, Tcl, Perl, PHP, Lua, Java, C and C++ - and MySQL, Linux and Solaris/SunOS too. Our training notes are now very much out of date, but due to upward compatability most of our examples remain operational and even relevant ad you are welcome to make us if them "as seen" and at your own risk.

Lisa and I (Graham) now live in what was our training centre in Melksham - happy to meet with former delegates here - but do check ahead before coming round. We are far from inactive - rather, enjoying the times that we are retired but still healthy enough in mind and body to be active!

I am also active in many other area and still look after a lot of web sites - you can find an index ((here))
globally refresh text-related widgets?

Posted by that_guy (that_guy), 4 August 2003
hello. I have a program where after reloading a dataset a large number of widgets should change their contents. I.e. if I load an existing experiment, all the scrolledlistboxes and text widgets, etc., should now display content reflecting the experiment currently in use. Is there a standard(or at least fairly common) way to do this sort of  task? Right now when I load an experiment, several arrays used in the program are correctly populated with the new values. I'm not sure how to translate this into an update of all the text related widgets other than perhaps writing a proc that painstakingly takes some action for each widget.  I'm guessing there's no such thing as a top level forget and repack with new values command...  

Posted by admin (Graham Ellis), 4 August 2003
This is one of those things that Tk is really great at doing.  

Take a look at the label widget (just as an example).  It has a -textvariable option, and that means that the label displays what's in the variable.  You change the variable contents in your Tcl, and what's displayed on the label changes.  No need to run a change command or call a special proc or anything like that.

And even greater news; -textvariable is a standard option that works on all appropriate widgets.  If you use on a user-changeable widget, it gives your user a way to change the variable ...

Oh - and if you (example) increase the length of text in a widget in this way, you don't have to repack either.  That's automatic the next time your event loop has the queue empty.  Its REAL neat  

Posted by that_guy (that_guy), 6 August 2003
thanks for the suggestion - I guess my real problem is that I haven't organized things to make that convenient. I've had the widgets get their content via procedures because the way that the data is stored does not necessarily correspond to how it's displayed.  I'll have to see if I can rearrange things so that this is no longer the case.  



This page is a thread posted to the opentalk forum at www.opentalk.org.uk and archived here for reference. To jump to the archive index please follow this link.

© WELL HOUSE CONSULTANTS LTD., 2024: Well House Manor • 48 Spa Road • Melksham, Wiltshire • United Kingdom • SN12 7NY
PH: 01144 1225 708225 • FAX: 01144 1225 793803 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho