I was having segfault and other issues when I tried
gtk_image_get_pixmapon the resulting
GtkWidget. Apparently the storage method is done in such a way that you can't obtain a
What did work though, and actually turned out to be easier was
gtk_widget_render_icon. The second and third arguments are the same as the ones used for
gtk_image_create_from_stock, the last argument I just left blank, and for the first
GtkWidgetargument I just passed the reference to my main application window for the stock icon settings to be taken from.
The return from
GdkPixbufwhich I used with
gdk_cairo_set_source_pixbufbefore finally drawing the icon to my destination with
Here's a brief example.
ctx = gdk_cairo_create(buffer);
eyedropper = gtk_widget_render_icon (window, GTK_STOCK_COLOR_PICKER, GTK_ICON_SIZE_MENU, "");
gdk_cairo_set_source_pixbuf (ctx, eyedropper, x, y);