diff options
-rw-r--r-- | examples/Makefile.am | 3 | ||||
-rw-r--r-- | examples/gtk-clutter-events.c | 6 | ||||
-rw-r--r-- | examples/gtk-clutter-test.c | 6 |
3 files changed, 12 insertions, 3 deletions
diff --git a/examples/Makefile.am b/examples/Makefile.am index b7959fb..01b17f1 100644 --- a/examples/Makefile.am +++ b/examples/Makefile.am @@ -13,7 +13,8 @@ AM_CPPFLAGS = \ -I$(srcdir) -I$(top_srcdir) -I$(top_builddir)/clutter-gtk \ -DGLIB_DISABLE_DEPRECATION_WARNINGS \ -DGDK_DISABLE_DEPRECATION_WARNINGS \ - -DCLUTTER_DISABLE_DEPRECATION_WARNINGS + -DCLUTTER_DISABLE_DEPRECATION_WARNINGS \ + -DEXAMPLES_DATADIR=\"$(srcdir)\" AM_CFLAGS = $(MAINTAINER_CFLAGS) $(CLUTTER_GTK_DEPS_CFLAGS) common_deps = \ diff --git a/examples/gtk-clutter-events.c b/examples/gtk-clutter-events.c index d357b78..a433af5 100644 --- a/examples/gtk-clutter-events.c +++ b/examples/gtk-clutter-events.c @@ -3,6 +3,10 @@ #include <clutter-gtk/clutter-gtk.h> +#ifndef EXAMPLES_DATADIR +#define EXAMPLES_DATADIR "." +#endif + typedef struct { GtkWidget *window; @@ -181,7 +185,7 @@ main (gint argc, gchar **argv) NULL); /* Create the main texture that the spin buttons manipulate */ - pixbuf = gdk_pixbuf_new_from_file ("redhand.png", NULL); + pixbuf = gdk_pixbuf_new_from_file (EXAMPLES_DATADIR G_DIR_SEPARATOR_S "redhand.png", NULL); if (pixbuf == NULL) g_error ("Unable to load pixbuf\n"); diff --git a/examples/gtk-clutter-test.c b/examples/gtk-clutter-test.c index f15c265..e61cd84 100644 --- a/examples/gtk-clutter-test.c +++ b/examples/gtk-clutter-test.c @@ -11,6 +11,10 @@ #define WINHEIGHT 400 #define RADIUS 150 +#ifndef EXAMPLES_DATADIR +#define EXAMPLES_DATADIR "." +#endif + typedef struct SuperOH { ClutterActor *stage; @@ -146,7 +150,7 @@ main (int argc, char *argv[]) /* calling gtk_clutter_init* multiple times should be safe */ g_assert (gtk_clutter_init (NULL, NULL) == CLUTTER_INIT_SUCCESS); - pixbuf = gdk_pixbuf_new_from_file ("redhand.png", NULL); + pixbuf = gdk_pixbuf_new_from_file (EXAMPLES_DATADIR G_DIR_SEPARATOR_S "redhand.png", NULL); if (!pixbuf) g_error("pixbuf load failed"); |