Modal GtkMessageDialog on Win32
- From: asmith15 littlesvr ca
- To: gtk-app-devel-list gnome org
- Subject: Modal GtkMessageDialog on Win32
- Date: Sun, 2 Dec 2007 09:51:46 -0500 (EST)
Here's some code that gives me a modal dialog on Linux but not on Windows:
GtkWidget* dialog;
dialog = gtk_message_dialog_new(GTK_WINDOW(GBLmainWindow),
GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_MESSAGE_ERROR,
GTK_BUTTONS_CLOSE,
"asd");
gtk_dialog_run(GTK_DIALOG(dialog));
gtk_widget_destroy(dialog);
Here's some sililar code that does give me a modal dialog on Windows
(haven't tried on Linux):
GtkWidget* dialog;
dialog = gtk_dialog_new_with_buttons("Warning",
GTK_WINDOW(GBLmainWindow),
GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_STOCK_OK,
GTK_RESPONSE_ACCEPT,
NULL);
gtk_dialog_run(GTK_DIALOG(dialog));
gtk_widget_destroy(dialog);
According to the manual the gtk_dialog_run() makes sure the dialog is
modal, but it doesn't for the first case. I tried using
gtk_window_set_modal() and gtk_window_set_transient_for(), didn't help.
Is this a bug in GTK? If so, is it better to wait until it's fixed in GTK
or write my own gtk_message_dialog_new() that just calls
gtk_dialog_new_with_buttons()? Though I'd have to translate the window
title in that case..
Thanks in advance
Andrew
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]