Hi!
   I was looking for a non-hackish way of creating a GdkPixbuf object
out of stock icon. The first thing that comes to mind is:

------------------CODE SNIPPET BEGIN----------------------

image = gtk_image_new_from_stock (stock_id, size);
pixbuf = gtk_image_get_pixbuf (image);

------------------CODE SNIPPET END-------------------------

  However that doesn't work since the created image if of storage type
GTK_IMAGE_STOCK and gtk_image_get_pixbuf() doesn't like that.
Following is the only way i could come up with:

------------------CODE SNIPPET BEGIN----------------------

image = gtk_image_new ();
pixbuf = gtk_widget_render_icon (image, stock_id, size, NULL);

------------------CODE SNIPPET END-------------------------

    This one works quite fine but is obviously hackish, Does anyone
know of any better way of doing the same?

-- 
Regards,

Zeeshan Ali
FSF member#5124
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Reply via email to