[libgd/wip/taggedentry] Add tagged entry test



commit c039aa5271459952813bc83080a74390b15385b7
Author: Ignacio Casal Quinteiro <ignacio casal nice-software com>
Date:   Sat Jul 13 12:15:59 2013 +0200

    Add tagged entry test

 Makefile.am         |    9 +++++++++
 test-tagged-entry.c |   32 ++++++++++++++++++++++++++++++++
 2 files changed, 41 insertions(+), 0 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index 9751494..2816abf 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -199,6 +199,15 @@ tagged_entry_sources =                             \
 
 nodist_libgd_la_SOURCES += $(tagged_entry_sources)
 EXTRA_DIST += $(tagged_entry_sources)
+
+noinst_PROGRAMS += test-tagged-entry
+test_tagged_entry_SOURCES =                            \
+       test-tagged-entry.c                             \
+       $(NULL)
+test_tagged_entry_LDADD =                              \
+       $(LIBGD_LIBS)                           \
+       libgd.la                                \
+       $(NULL)
 endif
 
 if LIBGD_GIR
diff --git a/test-tagged-entry.c b/test-tagged-entry.c
new file mode 100644
index 0000000..c3bf134
--- /dev/null
+++ b/test-tagged-entry.c
@@ -0,0 +1,32 @@
+#include <gtk/gtk.h>
+#include <libgd/gd-tagged-entry.h>
+
+gint
+main (gint argc,
+      gchar ** argv)
+{
+  GtkWidget *window, *box, *entry;
+
+  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);
+  gtk_container_add (GTK_CONTAINER (window), box);
+
+  entry = gd_tagged_entry_new ();
+  gtk_container_add (GTK_CONTAINER (box), entry);
+
+  gd_tagged_entry_add_tag_styled (GD_TAGGED_ENTRY (entry),
+                                  "tag1", "Blah", "search-tip", FALSE);
+  gd_tagged_entry_add_tag (GD_TAGGED_ENTRY (entry),
+                           "tag2", "Blah2");
+
+  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]