Re: Win32 Modal dialog problem

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

 



Clive Levinson wrote:

Purely as a workaround, call gtk_window_presenton your main window from a callback connected to the "destroy" event on the dialog. Something like this (untested):

void on_dialog_destroyed(GtkWidget *dialog, gpointer data)
{
    gtk_window_present(GTK_WINDOW(data));
}
...
g_signal_connect(myDlg, "destroy", on_dialog_destroyed, _mainwnd);

--
Tim Evans
Applied Research Associates NZ
http://www.aranz.com/



Thanks Tim,
That worked a treat.
I do have another question regarding dialogs on Win32, I can't seem to get rid of
the minimise and maximise buttons on the dialogu title bar. This has the unfortunate
effect, that if the user clicks the minimise button, the dialog is hidden on
the desktop by other open applications, even though my application remains
open. Any work arounds for this?
Thanks,
Clive

You can use gdk_window_set_decorations(dialog->window) once the dialog has been realized. Put something into the a callback on the "realize" signal for the dialog. It's worth putting all this stuff together into a make_dialog function that will:
1. Add the "destroy" signal handler to present the transient owner
window, using
gtk_window_present(gtk_window_get_transient_for(dialog)).
2. Add the "realize" handler that calls
gdk_window_set_decorations(dialog->window, ...).
3. Does any other sensible calls including gtk_window_set_resizable
and gtk_window_set_position(GTK_WIN_POS_CENTER_ON_PARENT).


--
Tim Evans
Applied Research Associates NZ
http://www.aranz.com/
_______________________________________________

gtk-list@xxxxxxxxx
http://mail.gnome.org/mailman/listinfo/gtk-list

[Index of Archives]     [Touch Screen Library]     [GIMP Users]     [Gnome]     [KDE]     [Yosemite News]     [Steve's Art]

  Powered by Linux