Re: stock items: how this stuff works ?



Vincent Torri wrote:

Hello,

I am trying to make a small program which can use images like stock icons
in gtk. I have implemented some functions to handle icons, but i am not
satisfied with them. My main purpose is to retrieve the path and the
name of the image file.

So i looked at the gtk source code. I think that there is two files that
are important : gtkimage.h/c and gtkstock.h/c. But i can't find where you
retrieve the path and the name of the icon (in the
gtk_image_new_from_stock for example)

Could you explain me how it works ?
Hi,
The stock icons are stuffed inside the library. gtk_image_from_stock() gets a const id for each stock icon, not a path to file. You can get stock images from gtk+ distro, "gtk+-2*/gtk/stock-icons" subdir. BTW you may wan to examine generated "gtkstockpixbufs.h" file there and look at 'man gdk-pixbuf-csource'.

   Olexiy




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