Re: Two gtk_main() ?? What to know ?




Sven Anders <anderss@fmi.uni-passau.de> writes:

> Hello !
> 
> I want to use two gtk_main() in my program. I know it is possible.
> What I want to know is, has anybody experience with it and what do
> I have to pay attention to ?!
> Are there any pitfalls ? Any "must not"'s ?
> What do I have to know in addition ?

I'm not quite sure what you mean by "two gtk_main()"

One possibility is a recursive gtk_main(). That is, in
some callback, calling gtk_main().

This is a commonly used way to handle model dialogs - something
like:

 gtk_window_set_modal (GTK_WINDOW (dialog));
 gtk_signal_connect (GTK_OBJECT (dialog), "destroy",
                     GTK_SIGNAL_FUNC (gtk_main_quit()), NULL);
 gtk_widget_show (dialog);
 gtk_main();

The other possibility is that you mean two separate main
loops running in two separate threads. This isn't possible
currently. (In retrospect, this was one of the things I
should have done differently in the GLib main loop
design).

Regards,
                                        Owen



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