RE: Opening a background window in a separate thread

From: Dov Grobgeld

The following change allows you to put the main window on top:

     g_signal_connect(G_OBJECT(dlgWin), "response", G_CALLBACK(dlgResponse), NULL);
>   gtk_window_set_transient_for(GTK_WINDOW(dlgWin), NULL);

You can also create the dialog with NULL as its parent widget, if you don't care that its initial placement will be in the middle of the main window.


Thanks Dov, but…


Creating the dialog with NULL as its parent widget doesn’t make a difference (I’d already tried that). The gtk_window_set_transient_for trick almost works, but not quite. With that the main app window comes to the front if I click on a control in it, but not if I click elsewhere in the window (same in both win64 and Linux). I tried capturing the “focus-in-event” on the window and executing “gdk_window_raise(gtk_widget_get_window(win))” but that didn’t help.








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