for my $image (@images) { Gtk2->main_iteration while Gtk2->events_pending;