Getting started with gdk-pixbuf (gtk-win32)



Hi there,

I've been using GTK under Linux for a year or so - and more recently, under
Cygwin - so I have a passable knowledge of GTK but I'm not an expert.
Recently I decided to take a look at the win32 backend for GTK which I
downloaded last week.  For ease of use I'm using Cygwin's gcc compiler at
present although that might change to MinGW.  Here's a simple program that
works both for Linux and Cygwin (with gtk-x11).

int main (int argc, char *argv[])
{
   gtk_init (&argc, &argv);

   GError* error = 0;
   GdkPixbuf *const pixbuf =
       gdk_pixbuf_new_from_file("/usr/local/share/icons/left_arrow.png",
&error);

   return 0;
}

Here's a very similar program that DOESN'T work if I build with gtk-win32:-

int main (int argc, char *argv[])
{
   gtk_init (&argc, &argv);

   GError* error = 0;
   GdkPixbuf *const pixbuf =
       gdk_pixbuf_new_from_file("c:/cygwin/usr/local/share/icons/left_arrow.png",
&error);

   return 0;
}

'error' consistently gives me this message:-

Couldn't recognize the image file format for file
"c:/cygwin/usr/local/share/icons/left_arrow.png".

I've come to the conclusion that gdk-pixbuf's loader files can't be found.
After a bit of digging I found a file called 'gdk-pixbuf.loaders' which
contains the paths to the various loaders - but it's the standard file that
came with the gtk-win32-dev package (which I simply unzipped) and of course,
those paths aren't relevant to my system.  I'm now thinking that after
unzipping the package, I should have built something or maybe run a config
utility of some sort.

After unpacking gtk-win32-dev, should I have carried out some more steps or
should it have just worked "out of the box"?

Thanks,

John




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]