diff options
author | Benjamin Otte <otte@redhat.com> | 2013-01-29 17:10:30 +0100 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2013-02-01 17:42:44 +0100 |
commit | 4f93194039a16d7ef0352a13224781182db76371 (patch) | |
tree | 34388672eacb29695beda0bb051ba8447c20ef30 /demos/gtk-demo | |
parent | 704fc3724fec8d2f0340a9893b02eab35bfb3091 (diff) | |
download | gtk+-4f93194039a16d7ef0352a13224781182db76371.tar.gz |
gtk-demo: Port builder example to resources
Diffstat (limited to 'demos/gtk-demo')
-rw-r--r-- | demos/gtk-demo/Makefile.am | 2 | ||||
-rw-r--r-- | demos/gtk-demo/builder.c | 5 | ||||
-rw-r--r-- | demos/gtk-demo/demo.gresource.xml | 3 |
3 files changed, 5 insertions, 5 deletions
diff --git a/demos/gtk-demo/Makefile.am b/demos/gtk-demo/Makefile.am index afdda22d21..7e23da63f2 100644 --- a/demos/gtk-demo/Makefile.am +++ b/demos/gtk-demo/Makefile.am @@ -79,7 +79,6 @@ BUILT_SOURCES = demos.h demo_resources.c EXTRA_DIST += \ $(IMAGEFILES) \ - demo.ui \ demo.gresource.xml \ $(RESOURCES) \ org.gtk.Demo.gschema.xml @@ -113,6 +112,7 @@ demo_resources.c: demo.gresource.xml $(RESOURCES) $(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=$(srcdir) --generate-source $(srcdir)/demo.gresource.xml RESOURCES= application.ui \ + demo.ui \ menus.ui \ theming.ui \ gtk-logo-24.png \ diff --git a/demos/gtk-demo/builder.c b/demos/gtk-demo/builder.c index f0691af490..663fffd91e 100644 --- a/demos/gtk-demo/builder.c +++ b/demos/gtk-demo/builder.c @@ -38,14 +38,11 @@ do_builder (GtkWidget *do_widget) { static GtkWidget *window = NULL; GError *err = NULL; - gchar *filename; if (!window) { builder = gtk_builder_new (); - filename = demo_find_file ("demo.ui", NULL); - gtk_builder_add_from_file (builder, filename, &err); - g_free (filename); + gtk_builder_add_from_resource (builder, "/builder/demo.ui", &err); if (err) { g_error ("ERROR: %s\n", err->message); diff --git a/demos/gtk-demo/demo.gresource.xml b/demos/gtk-demo/demo.gresource.xml index ad24bb81a2..33c0962a62 100644 --- a/demos/gtk-demo/demo.gresource.xml +++ b/demos/gtk-demo/demo.gresource.xml @@ -12,6 +12,9 @@ <file>cssview.css</file> <file>reset.css</file> </gresource> + <gresource prefix="/builder"> + <file>demo.ui</file> + </gresource> <gresource prefix="/css_accordion"> <file alias="gtk.css">css_accordion.css</file> </gresource> |