gtk-demo: Port builder example to resources

This commit is contained in:
Benjamin Otte 2013-01-29 17:10:30 +01:00
parent 704fc3724f
commit 4f93194039
3 changed files with 5 additions and 5 deletions

View File

@ -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 \

View File

@ -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);

View File

@ -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>