]> saetta.ns0.it Git - libgtkcalendarex/commitdiff
Started test.
authorAndrea Zagli <azagli@libero.it>
Mon, 1 Nov 2010 07:55:05 +0000 (08:55 +0100)
committerAndrea Zagli <azagli@libero.it>
Mon, 1 Nov 2010 07:55:05 +0000 (08:55 +0100)
tests/Makefile.am
tests/test.c
tests/test.ui [new file with mode: 0644]

index 17534457d718aadcadb3381fad2effff37105e60..6fca5c497875b52056d9bf5b3784098494719d84 100644 (file)
@@ -1,7 +1,9 @@
-LIBS = $(GTKCALEX_LIBS)
+LIBS = $(GTKCALEX_LIBS) \
+       -export-dynamic
 
 AM_CPPFLAGS = $(GTKCALEX_CFLAGS) \
-              -I$(top_srcdir)/src
+              -I$(top_srcdir)/src \
+              -DGUIDIR="\"@abs_builddir@\""
 
 libgtkcalendarex = $(top_builddir)/src/libgtkcalendarex.la
 
@@ -9,3 +11,6 @@ noinst_PROGRAMS = \
                   test
 
 LDADD = $(libgtkcalendarex)
+
+EXTRA_DIST = \
+             test.ui
index f952f6a4111b3fe788d2d4c849cb8ebd91f4d41a..211f551a6edad58500082e57652017dfd08a0884 100644 (file)
  * Foundation, Inc., 51 Franklin Street, Fifth Floor Boston, MA 02110-1301,  USA
  */
 
+#include <gtk/gtk.h>
+
 #include <libgtkcalendarex.h>
 
 int
 main (int argc, char **argv)
 {
+       GtkBuilder *gtkbuilder;
+       GError *error;
+       GtkWidget *w;
+
+       gtk_init (&argc, &argv);
+
+       gtkbuilder = gtk_builder_new ();
+       error = NULL;
+       if (!gtk_builder_add_from_file (gtkbuilder, GUIDIR "/test.ui", &error))
+               {
+                       g_error ("Error on opening gui: %s.", error != NULL && error->message != NULL ? error->message : "no details");
+                       return 0;
+               }
+
+       w = GTK_WIDGET (gtk_builder_get_object (gtkbuilder, "window1"));
+
+       gtk_builder_connect_signals (gtkbuilder, NULL);
+
+       gtk_widget_show_all (w);
+
+       gtk_main ();
+
        return 0;
 }
diff --git a/tests/test.ui b/tests/test.ui
new file mode 100644 (file)
index 0000000..a6ba3ad
--- /dev/null
@@ -0,0 +1,13 @@
+<?xml version="1.0"?>
+<interface>
+  <requires lib="gtk+" version="2.16"/>
+  <!-- interface-naming-policy project-wide -->
+  <object class="GtkWindow" id="window1">
+    <property name="default_width">550</property>
+    <property name="default_height">400</property>
+    <signal name="delete_event" handler="gtk_main_quit"/>
+    <child>
+      <placeholder/>
+    </child>
+  </object>
+</interface>