[gtk+] testgtk: Show GtkSettings



commit 909fe122820e05cd0bd7b272d89d00ad062f30cf
Author: Matthias Clasen <mclasen redhat com>
Date:   Thu Mar 22 00:17:08 2012 -0400

    testgtk: Show GtkSettings

 tests/testgtk.c |   26 ++++++++++++++++++++++++++
 1 files changed, 26 insertions(+), 0 deletions(-)
---
diff --git a/tests/testgtk.c b/tests/testgtk.c
index e6310ea..2e6304a 100644
--- a/tests/testgtk.c
+++ b/tests/testgtk.c
@@ -5999,6 +5999,31 @@ create_notebook (GtkWidget *widget)
     gtk_widget_destroy (window);
 }
 
+void
+create_settings (GtkWidget *widget)
+{
+  static GtkWidget *window = NULL;
+
+  if (!window)
+    {
+      window = create_prop_editor (G_OBJECT (gtk_settings_get_default ()), 0);
+      gtk_window_set_screen (GTK_WINDOW (window),
+                             gtk_widget_get_screen (widget));
+
+      gtk_widget_hide (window);
+      gtk_window_set_title (GTK_WINDOW (window), "GTK+ Settings");
+
+      g_signal_connect (window, "destroy",
+                        G_CALLBACK (gtk_widget_destroyed),
+                        &window);
+    }
+
+  if (!gtk_widget_get_visible (window))
+    gtk_widget_show (window);
+  else
+    gtk_widget_destroy (window);
+}
+
 /*
  * GtkPanes
  */
@@ -9644,6 +9669,7 @@ struct {
   { "rotated text", create_rotated_text },
   { "saved position", create_saved_position },
   { "scrolled windows", create_scrolled_windows },
+  { "settings", create_settings },
   { "shapes", create_shapes },
   { "size groups", create_size_groups },
   { "snapshot", create_snapshot },



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