in reply to Re: zimg -- Perl/Gtk2 quick slideshow
in thread zimg -- Perl/Gtk2 quick slideshow
Now, it would seem that you could just wait until the expose event occurs before proceeding. What the best way to do that is probably a resettable flag $is_image_exposed, and go into a non-blocking delay until it is 1.sub load_image { ... .... .... $vp->add( $image ); # add event watcher $image->signal_connect( event => sub { my ( $item, $event ) = @_; warn "event " . $event->type . "\n"; return 0; #return 1 prevents window from closing # return 0 lets the signal thru } ); ..... ..... }
I havn't tested that, and there may be other ways. Read "perldoc Gtk2::Widget" and look for things like "$widget->has_screen" ( and others).
The docs for Gtk2 are pretty meager, and require alot of experimentation to get the right code.
But if you ask me, just set the delay slower. :-)
|
|---|