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

已查看 32 次
跳至第一个未读帖子

Clifton Wood

未读,
2018年10月15日 11:17:272018/10/15
收件人 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

未读,
2018年10月15日 12:04:252018/10/15
收件人 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

未读,
2018年10月15日 23:54:522018/10/15
收件人 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

未读,
2018年10月16日 16:10:342018/10/16
收件人 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.
回复全部
回复作者
转发
0 个新帖子