<file>transparent.c</file>
<file>tree_store.c</file>
</gresource>
+ <gresource prefix="/textview">
+ <file>floppybuddy.gif</file>
+ <file>gtk-logo-rgb.gif</file>
+ </gresource>
</gresources>
GtkTextIter start, end;
GdkPixbuf *pixbuf;
GdkPixbuf *scaled;
- char *filename;
- /* demo_find_file() looks in the current directory first,
- * so you can run gtk-demo without installing GTK, then looks
- * in the location where the file is installed.
- */
- pixbuf = NULL;
- filename = demo_find_file ("gtk-logo-rgb.gif", NULL);
- if (filename)
- {
- pixbuf = gdk_pixbuf_new_from_file (filename, NULL);
- g_free (filename);
- }
-
- if (pixbuf == NULL)
- {
- g_printerr ("Failed to load image file gtk-logo-rgb.gif\n");
- exit (1);
- }
+ pixbuf = gdk_pixbuf_new_from_resource ("/textview/gtk-logo-rgb.gif", NULL);
+ g_assert (pixbuf);
scaled = gdk_pixbuf_scale_simple (pixbuf, 32, 32, GDK_INTERP_BILINEAR);
g_object_unref (pixbuf);
}
else if (i == 3)
{
- gchar *filename = demo_find_file ("floppybuddy.gif", NULL);
- widget = gtk_image_new_from_file (filename);
- g_free (filename);
+ widget = gtk_image_new_from_resource ("/textview/floppybuddy.gif");
}
else if (i == 4)
{