widget-factory: add the logo

This commit is contained in:
Matthias Clasen 2012-02-09 09:06:18 -05:00
parent 71efe31f16
commit 56f8cf91e0
4 changed files with 25 additions and 3 deletions

View File

@ -3,7 +3,8 @@ include $(top_srcdir)/Makefile.decl
bin_PROGRAMS = gtk3-widget-factory bin_PROGRAMS = gtk3-widget-factory
gtk3_widget_factory_SOURCES = \ gtk3_widget_factory_SOURCES = \
widget-factory.c widget-factory.c \
widget_factory_resources.c
gtk3_widget_factory_DEPENDENCIES = \ gtk3_widget_factory_DEPENDENCIES = \
$(top_builddir)/gtk/libgtk-3.la $(top_builddir)/gtk/libgtk-3.la
@ -17,4 +18,10 @@ gtk3_widget_factory_LDADD = \
$(top_builddir)/gdk/libgdk-3.la \ $(top_builddir)/gdk/libgdk-3.la \
$(top_builddir)/gtk/libgtk-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

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

View File

@ -39,11 +39,14 @@ dark_toggled (GtkCheckMenuItem *item, gpointer data)
static void static void
show_about (GtkMenuItem *item, GtkWidget *window) show_about (GtkMenuItem *item, GtkWidget *window)
{ {
GdkPixbuf *pixbuf;
const gchar *authors[] = { const gchar *authors[] = {
"Andrea Cimitan", "Andrea Cimitan",
"Cosimo Cecchi" "Cosimo Cecchi"
}; };
pixbuf = gdk_pixbuf_new_from_resource ("/logos/gtk-logo-256.png", NULL);
gtk_show_about_dialog (GTK_WINDOW (window), gtk_show_about_dialog (GTK_WINDOW (window),
"program-name", "GTK+ Widget Factory", "program-name", "GTK+ Widget Factory",
"version", g_strdup_printf ("%s,\nRunning against GTK+ %d.%d.%d", "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", "website", "http://www.gtk.org",
"comments", "Program to demonstrate GTK+ themes and widgets", "comments", "Program to demonstrate GTK+ themes and widgets",
"authors", authors, "authors", authors,
"logo", pixbuf,
"title", "About GTK+ Widget Factory", "title", "About GTK+ Widget Factory",
NULL); NULL);
g_object_unref (pixbuf);
} }
int int
@ -74,7 +80,7 @@ main (int argc, char *argv[])
dark = TRUE; dark = TRUE;
builder = gtk_builder_new (); 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")); window = GTK_WIDGET (gtk_builder_get_object (builder, "window"));
gtk_builder_connect_signals (builder, NULL); gtk_builder_connect_signals (builder, NULL);

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