[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
Re: timeouts
- From: Chas Owens <alas widomaker com>
- To: gtk-perl mailing list <gtk-perl-list gnome org>
- Subject: Re: timeouts
- Date: Thu, 11 Sep 2003 12:24:57 -0400 (EDT)
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]