GTK/Gnome version: non-modal options dialog

The place to discuss creating, porting and modifying Celestia's source code.
Topic author
Olaf Klischat

GTK/Gnome version: non-modal options dialog

Post #1by Olaf Klischat » 27.03.2004, 17:06

Hi,

I originally posted this on the users forum (see http://www.shatters.net/forum/viewtopic.php?t=4749).

The following patch makes the Render/Options dialog in the GTK/Gnome frontend non-modal, which IMHO is a great relief if you want to change rendering options quickly and frequently.

Code: Select all

--- celestia-1.3.0-orig/src/celestia/gtkmain.cpp        2002-12-09 21:40:13.000000000 +0100
+++ celestia-1.3.0/src/celestia/gtkmain.cpp     2004-03-27 17:08:34.000000000 +0100
@@ -598,7 +598,7 @@
        // Try to de-iconify and raise the dialog.
        gdk_window_show((optionDialog)->window);
        gdk_window_raise((optionDialog)->window);
-       gnome_dialog_run_and_close(GNOME_DIALOG(optionDialog));
+        gtk_widget_show(optionDialog);
         return;
     }
     optionDialog = gnome_dialog_new("Options", GNOME_STOCK_BUTTON_OK, NULL);
@@ -684,10 +684,10 @@
     resyncAll();
 
     gnome_dialog_close_hides(GNOME_DIALOG(optionDialog), true);
-    gtk_window_set_modal(GTK_WINDOW(optionDialog), TRUE);
+    gtk_window_set_modal(GTK_WINDOW(optionDialog), FALSE);
     gnome_dialog_set_parent((GnomeDialog*) optionDialog, GTK_WINDOW(mainWindow));
     gnome_dialog_set_default((GnomeDialog*) optionDialog, GNOME_YES);
-    gnome_dialog_run_and_close(GNOME_DIALOG(optionDialog));
+    gtk_widget_show(optionDialog);
 }


I've also uploaded this to my home page, just in case...: http://user.cs.tu-berlin.de/~klischat/celestia-gtk-nonmodal.diff

Return to “Development”