Can't quit main loop



Hi,

i'm trying to make a very simple program that shows the gtk file
chooser, and quits after the user selects something.

So basically i called gtk_file_chooser_dialog_new, and did:

---------
if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_ACCEPT) {
   gtk_widget_destroy (dialog);
   gtk_main_quit ();
} 
else {
   gtk_widget_destroy (dialog);
   gtk_main_quit ();
}

gtk_main ();
return 0;
--------

The thing is: the gtk_main_quit is being called, but i'm getting this error:

"Gtk-CRITICAL **: file gtkmain.c: line 1231 (gtk_main_quit): assertion
`main_loops != NULL' failed"

Why's that?

I've taken a look at zenity's code, but zenity uses a callback... i
didn't want to use callback for this.

Thanks,
J.V.



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