more useful options | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Curses::UI does have methods for timed events, but they are not documented. You need to read the source to find them. Based on a quick scan it looks like you need to do something like $cui->set_timer( $timer_id, $callback_ref );. There is an optional 3rd parm that seems to be # of seconds delay, default 1. When you set_timer it is enabled. Methods disable_timer and enable_timer both take just one parm, the $timer_id. Modus operandi: The CUI mainloop does some setup, then enters the following infinite loop: while ($self->{mainloop}) { $self->do_one_event }. do_one_event does various things including checking for keypress and mouse movement. One of the various things is do_timer, which loops through all the existing $timer_ids and executes their callbacks. update: couldn't resist playing with it:
In reply to Re: Curses::UI callbacks
by keszler
|
|