Re: Gtk->main



Eric wrote:

Hi, I'm writing my first Gtk app and I've had some trouble.

My understanding from the reference documents, tutorials and example code 
was that Gtk::main was supposed to be a loop that does not return.  That 
does not seem to be the case on my machine.  Even if I run the Goodbye 
World example program from the gtk-perl tutorial, the program exits 
immediately after the call to "main Gtk;"  If I put a print statement on 
the line after it, it prints out.  I thought this wasn't supposed to 
happen.
AFAIK Gtk->main() loops handling events until Gtk->main_quit() is called
and the program drops through to continue at the next line (print).

[...]
PS I've also tried to make my own loop by calling:

while(1)
{
Gtk->main_iteration();
}
This segfaults.
Try 
    Gtk->main_iteration while Gtk->events_pending;

HTH, Dermot






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