From: Andrew Ruthven Date: Wed, 17 Sep 2008 21:28:18 +0000 (+1200) Subject: Move the Glib::Timeout into the module, since most modules will want differing timeouts. X-Git-Url: http://git.etc.gen.nz/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5c734fde1a25c9ddcc13fe4958da3f7cff3550a0;p=picture-display.git Move the Glib::Timeout into the module, since most modules will want differing timeouts. --- diff --git a/lib/Display/Plugins/FSpot.pm b/lib/Display/Plugins/FSpot.pm index 941c5da..437a11d 100644 --- a/lib/Display/Plugins/FSpot.pm +++ b/lib/Display/Plugins/FSpot.pm @@ -74,6 +74,8 @@ LIMIT 1 $self->{'picture'}->set('sync-size' => 1); $self->display(); $self->{'stage'}->add($self->{'picture'}); + + Glib::Timeout->add_seconds(30, $self->can('display'), $self); } 1; diff --git a/picture.pl b/picture.pl index 0a135c1..9d1a71e 100755 --- a/picture.pl +++ b/picture.pl @@ -28,15 +28,12 @@ my @modules = loadModules(); $stage->show_all(); -Glib::Timeout->add_seconds(30, \&update_screen); - Clutter->main(); sub update_screen { for my $module (@modules) { $module->display(); } - Glib::Timeout->add_seconds(30, \&update_screen); } sub loadModules {