| |||||||||||
| |||||||||||
Fonctionnement Perl/Tkto Posted by dje76 (dje76), 5 September 2004 ![]() Hello, 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:![]() 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 Hello,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 www.opentalk.org.uk and
archived here for reference. To jump to the archive index please
follow this link.
|
| ||||||||||
PH: 01144 1225 708225 • FAX: 01144 1225 793803 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho |