Re: Opening a background window in a separate thread



There is no need for a thread at all. Just create the dialog window with

   GtkWidget *dialog = gtk_message_dialog_new()

or similar and then do gtk_widget_show() on it. ֿIt indeed responds to events just like any other widget if you set them up properly with g_signal_connect(). Why do you think that you need a thread for that?

Regards,
Dov

2008/12/1 Ian Puleston <ian underpressuredivers com>
> -----Original Message-----
> From: Mike Massonnet
>
> "Ian Puleston" <ian underpressuredivers com> a �crit :
>
> > > What I want to do is to open a "help" window that the user can keep
> > > open while they are working in the main app window.
>
> You have to set proper window flags on the dialog.  It must not be set
> as modal, see [1] for this.

In fact I don't create my current help window as a modal dialog window but I do use gtk_dialog_run() which effectively makes it modal since the main thread is not processing events from the top level window while in there.

So the next question becomes how to run a non-modal dialog window without using gtk_dialog_run(). The GtkDialog documentation hints that it's not necessary to use gtk_dialog_run() but doesn't say what the alternative is. I tried simply creating and showing the dialog window (with just the one option - GTK_DIALOG_DESTROY_WITH_PARENT) and then letting the thread return to the main loop. But with this I find that although the main window does respond to mouse clicks, it stays behind the dialog window while that is open. Is there something that I need to do to bring it to the front when its clicked on?

Ian


_______________________________________________
gtk-list mailing list
gtk-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-list



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