Date: Fri, 17 Sep 2004 09:05:42 +0900 (JST) Message-Id: <20040917.090542.59460509.garrigue at kurims.kyoto-u.ac.jp> To: andrieu at ijm.jussieu.fr Cc: lablgtk at kaba.or.jp Subject: Re: (Q) How to store "pixbuf" into GTree.model? From: Jacques Garrigue In-Reply-To: <20040914.160525.92586750.oandrieu at nerim.net> References: <004e01c493e5$eb2c9d60$1501a8c0 at hama> <20040914151922.733e64d0@tintin.inria.fr> <20040914.160525.92586750.oandrieu@nerim.net> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit From: Olivier Andrieu > let colpix = cols#add Gobject.Data.gobject in > > would is more likely to work (pixbufs are gobjects) Indeed, it works. > Anyway, the GTree code needs some fixing : right now it converts the > GTypes of the column list to fundamental types before creating the > GtkListStore of GtkTreeStore. It's wrong, I don't know why it does > this. This is due to the fact columns are made from data_conv's, and data_conv's only know fundamental types. (It think I tried to make data_conv's more general once, but bumped into problems with GTK. It's not always a good idea to tell too much about types to GTK...) GTK only checks the fundamental type of columns (accessing them with g_value_get_{object,boxed,...}), so this information is sufficient, at least for gobject's. On the other hand, there seems to be a real problem with boxed values, as you cannot create a GValue of a boxed type without knowing which one: # let v = Value.create (Type.of_fundamental `BOXED);; (ocaml:692): GLib-GObject-WARNING **: gvalue.c:95: cannot initialize GValue with type `GBoxed', this type has no GTypeValueTable implementation This should be solved at the gobject.ml level. Fortunately, boxed values are not a requirement for tree models, and this conversion problem does not apply to usual object properties (in that case, the type field of the data_conv is ignored) Jacques