Date: Tue, 14 Sep 2004 16:05:25 +0200 (CEST) Message-Id: <20040914.160525.92586750.oandrieu at nerim.net> To: maxence.guesdon at inria.fr Cc: shoh at compiler.kaist.ac.kr, lablgtk at kaba.or.jp Subject: Re: (Q) How to store "pixbuf" into GTree.model? From: Olivier Andrieu In-Reply-To: <20040914151922.733e64d0 at tintin.inria.fr> References: <004e01c493e5$eb2c9d60$1501a8c0 at hama> <20040914151922.733e64d0@tintin.inria.fr> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit > Maxence Guesdon [Tue, 14 Sep 2004 15:19:22 +0200]: > On Mon, 6 Sep 2004 16:47:56 +0900 > "SooHyoung Oh" wrote: > > > > > Could anyone help me to implement GTree.model > > which stores GdkPixbuf.pixbuf? > > I have the same problem. I have > > let cols = new GTree.column_list in > let colpix = cols#add Gobject.Data.pointer in let colpix : GdkPixbuf.pixbuf GTree.column = cols#add Gobject.Data.gobject in would is more likely to work (pixbufs are gobjects) > let renderer = (GTree.cell_renderer_pixbuf [], ["pixbuf", colpix]) in > let vcol = GTree.view_column ?title ~renderer () in > ... > and later : > let row = store#append () in > store#set ~row ~column: colpix myfavoritepixbuf > > but i nothing is displayed and i get error messages: > (example:5375): GLib-GObject-WARNING **: unable to set property `pixbuf' of type > `GdkPixbuf' from value of type `gpointer' > > (same with Gobject.Data.caml instead of Gobject.Data.pointer). > > Does someone know what the Right Way to do this is ? 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. -- Olivier