Re: getting the icon pixbuf for a file



On Thu, 16 Aug 2012 22:41:28 +0800
Just Fill Bugs <mozbugbox yahoo com au> wrote:

ä 08/16/2012 07:58 PM, Andreas RÃnnquist åé:
Hey

I am trying to get the icon bitmap for a file and insert it into a
TreeView widget - That is the pixbuf for the mime-type of a file. Is
there any examples of doing this in plain C using GTK/GLib?

I am satisfied with an example that work in Linux - Win32 isn't
equally important to me.


<http://developer.gnome.org/gdk-pixbuf/unstable/gdk-pixbuf-File-Loading.html>

#include <gdk-pixbuf/gdk-pixbuf.h>

...
GdkPixbuf *pix;
pix = gdk_pixbuf_new_from_file (fname, None);
if (!pix) return;

boom! cannot be easier than that!

Sorry, I mean loading the Pixbuf of the file-type / mime-type of a
file - Not simply loading a file into a pixbuf. That is a bit more
complicated getting...

Sorry for not being more precise.

/Andreas



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