[Gtk-sharp-list] TreeView with Pixbuf
Todd Berman
tberman@sevenl.net
Wed, 19 May 2004 13:11:37 -0400
On Wed, 2004-19-05 at 00:55 -0300, Gaston Alfredo Acuse wrote:
> Hello,
> can you show me why this funtion don't display the icon in the treeview?
>
> private void PopulateEntities ()
> {
> Gtk.Image image= new Gtk.Image();
> image.Pixbuf = new Gdk.Pixbuf("icon.png");
> TreeStore store = new TreeStore (typeof (Gdk.Pixbuf));
> treeview_entities.AppendColumn ("label", new CellRendererPixbuf (),
> "pixbuf", 0);
> store.AppendValues (image);
> treeview_entities.Model = store;
> treeview_entities.HeadersVisible = true;
> }
>
You are stuffing a Gtk.Image where a Gdk.Pixbuf goes.
try store.AppendValues (new Gdk.Pixbuf ("icon.jpg"));
--Todd
> where treeview_entites is defined like:
> [Glade.Widget] Gtk.TreeView treeview_entities;
>
> Thank you for your help.
>
> _________________________________________________________________
> The new MSN 8: smart spam protection and 2 months FREE*
> http://join.msn.com/?page=features/junkmail
>
> _______________________________________________
> Gtk-sharp-list maillist - Gtk-sharp-list@lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/gtk-sharp-list