From 681f19024f255a1ebc18d7ddee17622887bb94eb Mon Sep 17 00:00:00 2001 From: damien Date: Thu, 17 Jan 2002 09:54:12 +0000 Subject: added timeout for redrawing icon widget --- perl-install/my_gtk.pm | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'perl-install') diff --git a/perl-install/my_gtk.pm b/perl-install/my_gtk.pm index ef9928839..6cfb501ec 100644 --- a/perl-install/my_gtk.pm +++ b/perl-install/my_gtk.pm @@ -542,11 +542,15 @@ sub gtkicons_labels_widget { $fixed->put($_, 75, 65); $i++; } + my $timeout; $fixed->signal_connect(expose_event => sub { my ($fx, $fy) = ($fixed->allocation->[2], $fixed->allocation->[3]); - foreach (compute($fx, $fy, 40, 30, 5, @tab)) { - $fixed->move(@$_); - } + defined($timeout) or $timeout = Gtk->timeout_add(100, sub { + $fixed->move(@$_) foreach compute_icons($fx, $fy, 40, 30, 5, @tab); + Gtk->timeout_remove($timeout); + undef $timeout; + 0; + }); }); $fixed->signal_connect( realize => sub { $fixed->window->set_back_pixmap($background, 0) }); @@ -555,7 +559,7 @@ sub gtkicons_labels_widget { $fixed; } -sub compute { +sub compute_icons { my ($fx, $fy, $decx, $decy, $interstice, @tab) = @_; my $nb = $#tab; my $nb_sav = $nb; -- cgit v1.2.1