This is not strictly a NIM question - but it is in service to an attempt to
write a semi-cross-platform nim gui library. The question concerns gtk2
There is a need to load a pixbuf from a stock image - such as
**gtk-dialog-error**.
There seems to be no **pixbuf_new_from_stock** function.
The following attempted work-around:
var stockid = "gtk-dialog-error"
echo "stockid=",stockid
var img = image_new_from_stock(stockid,32)
echo "img=",cast[int](img).toHex(8)
var pixbuf = get_pixbuf(img)
echo "pixbuf=",cast[int](pixbuf).toHex(8)
produced this console output:
stockid=gtk-dialog-error
img=0858CC20
(test25:5319): Gtk-CRITICAL **: IA__gtk_image_get_pixbuf: assertion
'image->storage_type == GTK_IMAGE_PIXBUF || image->storage_type ==
GTK_IMAGE_EMPTY' failed
pixbuf=00000000
Can anyone suggest a way to implement **pixbuf_new_from_stock** ?
There are good reasons for wanting to do that - having to do with wrapping both
MSWIN and GTK with a common interface.
BTW, is there a way to convert Gtk error locations such as 5319 into nim source
line numbers??