diff --git a/demos/widget-factory/Makefile.am b/demos/widget-factory/Makefile.am index 93bb927230..80b81fb584 100644 --- a/demos/widget-factory/Makefile.am +++ b/demos/widget-factory/Makefile.am @@ -3,7 +3,8 @@ include $(top_srcdir)/Makefile.decl bin_PROGRAMS = gtk3-widget-factory gtk3_widget_factory_SOURCES = \ - widget-factory.c + widget-factory.c \ + widget_factory_resources.c gtk3_widget_factory_DEPENDENCIES = \ $(top_builddir)/gtk/libgtk-3.la @@ -17,4 +18,10 @@ gtk3_widget_factory_LDADD = \ $(top_builddir)/gdk/libgdk-3.la \ $(top_builddir)/gtk/libgtk-3.la -EXTRA_DIST += widget-factory.ui +widget_factory_resources.c: widget-factory.gresource.xml $(shell $(GLIB_COMPILE_RESOURCES) --generate-dependencies $(srcdir)/widget-factory.gresource.xml) + $(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=$(srcdir) --generate-source $< + +EXTRA_DIST += \ + widget-factory.ui \ + widget-factory.gresource.xml \ + gtk-logo-256.png diff --git a/demos/widget-factory/gtk-logo-256.png b/demos/widget-factory/gtk-logo-256.png new file mode 100644 index 0000000000..f488e4535c Binary files /dev/null and b/demos/widget-factory/gtk-logo-256.png differ diff --git a/demos/widget-factory/widget-factory.c b/demos/widget-factory/widget-factory.c index 6bb2761adc..b693422f06 100644 --- a/demos/widget-factory/widget-factory.c +++ b/demos/widget-factory/widget-factory.c @@ -39,11 +39,14 @@ dark_toggled (GtkCheckMenuItem *item, gpointer data) static void show_about (GtkMenuItem *item, GtkWidget *window) { + GdkPixbuf *pixbuf; const gchar *authors[] = { "Andrea Cimitan", "Cosimo Cecchi" }; + pixbuf = gdk_pixbuf_new_from_resource ("/logos/gtk-logo-256.png", NULL); + gtk_show_about_dialog (GTK_WINDOW (window), "program-name", "GTK+ Widget Factory", "version", g_strdup_printf ("%s,\nRunning against GTK+ %d.%d.%d", @@ -56,8 +59,11 @@ show_about (GtkMenuItem *item, GtkWidget *window) "website", "http://www.gtk.org", "comments", "Program to demonstrate GTK+ themes and widgets", "authors", authors, + "logo", pixbuf, "title", "About GTK+ Widget Factory", NULL); + + g_object_unref (pixbuf); } int @@ -74,7 +80,7 @@ main (int argc, char *argv[]) dark = TRUE; builder = gtk_builder_new (); - gtk_builder_add_from_file (builder, "./widget-factory.ui", NULL); + gtk_builder_add_from_resource (builder, "/ui/widget-factory.ui", NULL); window = GTK_WIDGET (gtk_builder_get_object (builder, "window")); gtk_builder_connect_signals (builder, NULL); diff --git a/demos/widget-factory/widget-factory.gresource.xml b/demos/widget-factory/widget-factory.gresource.xml new file mode 100644 index 0000000000..79bad5ba25 --- /dev/null +++ b/demos/widget-factory/widget-factory.gresource.xml @@ -0,0 +1,9 @@ + + + + gtk-logo-256.png + + + widget-factory.ui + +