[libgd] Add a test for GdRevealer
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgd] Add a test for GdRevealer
- Date: Fri, 8 Feb 2013 16:08:01 +0000 (UTC)
commit f22726af4f75adf6c728442af88f78a3b7792fda
Author: Cosimo Cecchi <cosimoc gnome org>
Date: Fri Feb 8 10:48:32 2013 -0500
Add a test for GdRevealer
Makefile.am | 9 +++++++++
test-revealer.c | 34 ++++++++++++++++++++++++++++++++++
2 files changed, 43 insertions(+), 0 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index 6fb49bb..c5fd528 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -120,6 +120,15 @@ revealer_sources = \
nodist_libgd_la_SOURCES += $(revealer_sources)
EXTRA_DIST += $(revealer_sources)
+
+noinst_PROGRAMS = test-revealer
+test_revealer_SOURCES = \
+ test-revealer.c \
+ $(NULL)
+test_revealer_LDADD = \
+ $(LIBGD_LIBS) \
+ libgd.la \
+ $(NULL)
endif
if LIBGD_TAGGED_ENTRY
diff --git a/test-revealer.c b/test-revealer.c
new file mode 100644
index 0000000..a977fa5
--- /dev/null
+++ b/test-revealer.c
@@ -0,0 +1,34 @@
+#include <gtk/gtk.h>
+#include <libgd/gd-revealer.h>
+
+gint
+main (gint argc,
+ gchar ** argv)
+{
+ GtkWidget *window, *revealer, *box, *widget, *entry;
+ guint i;
+
+ gtk_init (&argc, &argv);
+
+ window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
+ gtk_widget_set_size_request (window, 300, 300);
+
+ box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
+ widget = gtk_toggle_button_new_with_label ("Revealed");
+ gtk_container_add (GTK_CONTAINER (box), widget);
+ gtk_container_add (GTK_CONTAINER (window), box);
+
+ revealer = gd_revealer_new ();
+ entry = gtk_entry_new ();
+ gtk_container_add (GTK_CONTAINER (revealer), entry);
+ gtk_container_add (GTK_CONTAINER (box), revealer);
+
+ g_object_bind_property (widget, "active", revealer, "revealed", 0);
+
+ gtk_widget_show_all (window);
+ gtk_main ();
+
+ gtk_widget_destroy (window);
+
+ return 0;
+}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]