mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-26 13:41:07 +00:00
gtk-demo: Port builder example to resources
This commit is contained in:
parent
704fc3724f
commit
4f93194039
@ -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 \
|
||||
|
@ -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);
|
||||
|
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user