Training, Open Source computer languages
PerlPHPPythonMySQLApache / TomcatTclRubyJavaC and C++LinuxCSS 
Search for:
Home Accessibility Courses Diary The Mouth Forum Resources Site Map About Us Contact
 
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))
delayed evaluation for tk callbacks?

Posted by that_guy (that_guy), 8 August 2003
Hello.  I remember seeing a really useful post by Graham describing common mistakes made when dealing with delayed evaluation for Tk callbacks/ widget variables. I can't seem to find this post, so if anyone has  a link to it, I'd greatly appreciate it.  The question behind all this: is it possible to have the -textvariable of a widget be set to a delayed evaluation of a command? In this case that command would be a database query. In other words something like :
label .lbl -textvariable "{mysqlsel db "select ip_addr from hosts where host='$::host'}"    I'm not entirely sure how Tk's tracing works- but I'm guessing that  my question makes no sense because it
would cause the label to make countless database queries... and that instead I need to make sure that all methods modifying the database reflect their actions in a variable exposed to the widget.

Posted by admin (Graham Ellis), 10 August 2003
Graham answering briefly - I'm away from my office for a few days so I'll struggle to find it just like you.

Couple of tips:

1. You *can* do a -command as well as a -textvariable, so you can change a variable and run a proc when an interactive widget is changed.

2.  Note update idletasks if you want you display updated even if you haven't finished handling all events.

There's a history of all posts on our web site; if you go to http://www.wellho.net and enter some words that were uses in the search box (half way down left hand side) it will search many places including forum archives.   May help you find the article



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.

You can Add a comment or ranking to this page

© 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