Re: Getting a pixbuf from a stock icon

Stefano Esposito wrote:

Hi all,

i'm trying to get a Gtk2::Gdk::Pixbuf from a stock icon. I've tried using Gtk2::Image->get_pixbuf, creating 
an image from the stock, but Gtk2 returns a critical error about the image type, which isn't Pixbuf nor 
Empty. There is any other way?Or i've miss a step?

Thanks a lot :)

I just recently figured how to do this myself. It seems like everything
derived from Gtk2::Widget has a 'render_icon' method. So you just do:

my $pixbuf = $widget->render_icon("gtk-yes",    "menu");

Have a look at


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