[gtk+/font-chooser-api: 3/4] Add prop editors to testfontchooser{, dialog}



commit ed8f5e7f5870f08e554e7faaed347e06eb8661c9
Author: Christian Persch <chpe gnome org>
Date:   Mon Sep 5 14:10:08 2011 +0200

    Add prop editors to testfontchooser{,dialog}

 tests/Makefile.am             |    2 ++
 tests/testfontchooser.c       |    3 +++
 tests/testfontchooserdialog.c |   10 +++++++++-
 3 files changed, 14 insertions(+), 1 deletions(-)
---
diff --git a/tests/Makefile.am b/tests/Makefile.am
index ac05e62..8b8494d 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -361,9 +361,11 @@ testfontselectiondialog_SOURCES = \
 	testfontselectiondialog.c
 
 testfontchooser_SOURCES = \
+	prop-editor.c		\
 	testfontchooser.c
 
 testfontchooserdialog_SOURCES = \
+	prop-editor.c		\
 	testfontchooserdialog.c
 
 testgrid_SOURCES =	\
diff --git a/tests/testfontchooser.c b/tests/testfontchooser.c
index 4c6f42c..4ff3668 100644
--- a/tests/testfontchooser.c
+++ b/tests/testfontchooser.c
@@ -18,6 +18,7 @@
  */
 
 #include <gtk/gtk.h>
+#include "prop-editor.h"
 
 static void
 notify_font_name_cb (GObject *fontchooser, GParamSpec *pspec, gpointer data)
@@ -61,6 +62,8 @@ main (int argc, char *argv[])
   gtk_font_chooser_set_preview_text (GTK_FONT_CHOOSER (fontchooser), "[user host ~]$ &>>");
   gtk_font_chooser_set_show_preview_entry (GTK_FONT_CHOOSER (fontchooser), FALSE);
 
+  create_prop_editor (G_OBJECT (fontchooser), GTK_TYPE_FONT_CHOOSER);
+
   gtk_main ();
 
   return 0;
diff --git a/tests/testfontchooserdialog.c b/tests/testfontchooserdialog.c
index 23be106..37227c6 100644
--- a/tests/testfontchooserdialog.c
+++ b/tests/testfontchooserdialog.c
@@ -18,18 +18,26 @@
  */
 
 #include <gtk/gtk.h>
+#include "prop-editor.h"
 
 int
 main (int argc, char *argv[])
 {
   GtkWidget *window;
+  GtkWidget *font_button;
 
   gtk_init (&argc, &argv);
 
   window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
-  gtk_container_add (GTK_CONTAINER (window), gtk_font_button_new ());
+  font_button = gtk_font_button_new ();
+  gtk_container_add (GTK_CONTAINER (window), font_button);
   gtk_widget_show_all (window);
 
+  g_signal_connect (window, "delete-event",
+                    G_CALLBACK (gtk_main_quit), NULL);
+
+  create_prop_editor (G_OBJECT (font_button), GTK_TYPE_FONT_CHOOSER);
+
   gtk_main ();
 
   return 0;



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