Re: timeouts



Quoting Torsten Schoenfeld <kaffeetisch web de>:
On Thu, 11 Sep 2003 16:30:04 +0100, Bruno Tavares wrote:
How do i set up and/or remove a timeout in Gtk2?
in gtk1 was Gtk->timeout_add and friends...

It's Gtk::Timeout -> add(). See
http://gtk2-perl.sourceforge.net/doc/Gtk2::api.pod.html#missing_methods

HTH,
-Torsten

Event loop stuff got moved down two levels (from Gtk to Glib) in Gtk2.  So the
comment above should read:

Glib::Timeout->add($seconds, \&sub);

To remove a timeout return 0 from &sub or save the return from
Glib::Timeout->add and use the Glib::Source->remove function (Idle and Timeout
are both types of sources):

my $timeout_id = Glib::Timeout->add($seconds, \&sub);
Glib::Source->remove($timeout_id);



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