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))
Fonctionnement Perl/Tkto

Posted by dje76 (dje76), 5 September 2004


i have a new little problem:
how can i have a real time ProgressBar fonction with 0.01 seconds progress when i hold a key?
i see that Tk module concider a refresh of all windows only when i moove the mouse (or if i hit a key... or an event occurs with the window's select)... i hope there is a flag who can turn the module to automaticly refresh the windows each 5 miliseconds... or every time is possible... but i don't have the information....

PS: my code is write, but it has this problem: i must manualy moove the mouse for run to programm on....  

thanks a lot for your help.

Posted by admin (Graham Ellis), 5 September 2004
Have you looked at alarm signals ... ah, but they use 1 second granularity which doesn't sound like it's enough. The Camel book suggests the syscall function to access setitimer if your system supports it, or Timer::HiRes. I've not used these last two methods myself, but hope the pointer helps.

Posted by dje76 (dje76), 6 September 2004
Yes, i used Time::HiRes with setitimer ITIMER_REAL for $SIG{ALRM} signal with 0.01 second of interval delay (and 1 second before start, because i have a thread's runing in parrallel). And to see my real time holding space key (pressing and releasing) i used Tk:rogressBar.... but the problem is that i must moved the mouse in the main Windows for see the result of timing on the progress ber... and i try to send automaticly an event (with eventGenerate(...) in the sub-function link with the SIG signal) to refresh the windows in real time without success... that's why i see that Tk run a boucle from initialy main Window defined to mainloop() only when an event (the mouse's moved... a key's pressed) occurs.
I think that it must be possible to make something for refresh the windows without manually action on an input device.... but how to do this?

Posted by dje76 (dje76), 9 September 2004

My problem is resolved with :  $widget->repeat(ms=>callback);

where ms is a tempo in millisecond and callback is a sub-routing calling...

PS: with less than 10 ms, the prog seems to be too slow...

This page is a thread posted to the opentalk forum at 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: • WEB: • SKYPE: wellho