gtk2 equivalent of tk's do_one_loop



Hi,

I'm an absolute beginner at Gtk2,  but know Perl/Tk
fairly well, and I'm trying to compare how things are done.

In Tk, there is a way to loop through the main event loop
one time, how would I do it in Gtk2?

#!/usr/bin/perl -w
use strict;
use Gtk2;

Gtk2->init;
my $window = Gtk2::Window->new;
$window->signal_connect('destroy', sub { Gtk2->main_quit });

$window->add(Gtk2::Label->new("Hello World"));

$window->show_all;

print "1\n"; 

#Gtk2->main;  #what simulates looping?
while(1){
Gtk2->main_do_event ( 'one_loop' );  
}

Thanks.

-- 
I'm not really a human, but I play one on earth.
http://zentara.net/japh.html



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]