Re: Timers



* Juan Josà 'Peco' San MartÃn <peco microbotica es> [2005-07-01 01:35]:
My issue is that I would like to attach the same timer but to
other widgets, in order to update many of them at the same
time. Surely that it's possible but I didn't find the way :-/

Thatâs nothing to do with Gtk2. You just need to know Perl.
muppetâs suggestion of a Heartbeat object is nice, particularly
if you need to do this kind of thing more than in one place. For
a simple one-off where extensibility is not a concern, you can
just use a closure:

    my $timer = Glib::Timeout->add( 1000, sub {
        progress_timeout( $label );
        do_something_else( $progbar );
        spin( $my_beanie );
        etc( etc( etc() ) );
    } );

Regards,
-- 
#Aristotle
*AUTOLOAD=*_=sub{s/(.*)::(.*)/print$2,(",$\/"," ")[defined wantarray]/e;$1};
&Just->another->Perl->hacker;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]