From 77d6f3d5c2cace83d13e87a8c079d0b0a314a229 Mon Sep 17 00:00:00 2001 From: Andrea Zagli Date: Mon, 1 Nov 2010 08:55:05 +0100 Subject: [PATCH] Started test. --- tests/Makefile.am | 9 +++++++-- tests/test.c | 24 ++++++++++++++++++++++++ tests/test.ui | 13 +++++++++++++ 3 files changed, 44 insertions(+), 2 deletions(-) create mode 100644 tests/test.ui diff --git a/tests/Makefile.am b/tests/Makefile.am index 1753445..6fca5c4 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -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 diff --git a/tests/test.c b/tests/test.c index f952f6a..211f551 100644 --- a/tests/test.c +++ b/tests/test.c @@ -16,10 +16,34 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor Boston, MA 02110-1301, USA */ +#include + #include 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 index 0000000..a6ba3ad --- /dev/null +++ b/tests/test.ui @@ -0,0 +1,13 @@ + + + + + + 550 + 400 + + + + + + -- 2.49.0