What is the proper way to store a GdkPixbuf into a GValue object?

32 views
Skip to first unread message

Clifton Wood

unread,
Oct 15, 2018, 11:17:27 AM10/15/18
to Crystal
I am trying to store a GdkPixbuf into a GTK::IconView. However, due to limitations that I cannot control, I am not allowed to use gtk_list_store_set(). I am trying to use gtk_list_store_set_value(), but I am running into problems determining how to pack the GdkPixbuf into the GValue in a way that GtkIconView can understand. Currently, when I try this, I get a iconview with no icons. (please see the attached image).

My code is effectively this:

GValue *value;
g_value_init(G_TYPE_OBJECT, value)
g_value_set_object(G_VALUE(value), G_OBJECT(pixbuf));
gtk_list_store_set_value(GTK_LIST_STORE(model), iter, pixcol, value);

Where model is my GtkListStore, iter is my GtkTreeIter and pixcol is the column index of the GDK_TYPE_PIXBUF column.

Can someone assist?

Thanks.

- Xliff



Screenshot_20181015_111254.png

Chris Hobbs

unread,
Oct 15, 2018, 12:04:25 PM10/15/18
to crysta...@googlegroups.com

Wrong mailing list?

--
You received this message because you are subscribed to the Google Groups "Crystal" group.
To unsubscribe from this group and stop receiving emails from it, send an email to crystal-lang...@googlegroups.com.
To post to this group, send email to crysta...@googlegroups.com.
Visit this group at https://groups.google.com/group/crystal-lang.
To view this discussion on the web visit https://groups.google.com/d/msgid/crystal-lang/8771e131-241e-4bf0-948d-0b06a9732f65%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ryan Gonzalez

unread,
Oct 15, 2018, 11:54:52 PM10/15/18
to crystal-lang
I'm subscribed to both the GTK+ and Crystal mailing lists and was so confused for a few moments...

--
Ryan (ライアン)
Yoko Shimomura, ryo (supercell/EGOIST), Hiroyuki Sawano >> everyone else
https://refi64.com/

Tin Samuel

unread,
Oct 16, 2018, 4:10:34 PM10/16/18
to crysta...@googlegroups.com
Would be cool if there was a gtk add-on though.



For more options, visit https://groups.google.com/d/optout.


--
This email signature has super cow powers.
Reply all
Reply to author
Forward
0 new messages