forked from AuroraMiddleware/gtk
widget-factory: add the logo
This commit is contained in:
parent
71efe31f16
commit
56f8cf91e0
@ -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
|
||||
|
BIN
demos/widget-factory/gtk-logo-256.png
Normal file
BIN
demos/widget-factory/gtk-logo-256.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 10 KiB |
@ -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);
|
||||
|
9
demos/widget-factory/widget-factory.gresource.xml
Normal file
9
demos/widget-factory/widget-factory.gresource.xml
Normal file
@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<gresources>
|
||||
<gresource prefix="/logos">
|
||||
<file>gtk-logo-256.png</file>
|
||||
</gresource>
|
||||
<gresource prefix="/ui">
|
||||
<file preprocess="xml-stripblanks">widget-factory.ui</file>
|
||||
</gresource>
|
||||
</gresources>
|
Loading…
Reference in New Issue
Block a user