[Gtk-sharp-list] treeview help

ahmed el-helw ahmedre@cc.gatech.edu
Sun, 07 Mar 2004 19:40:35 -0500

i've been playing around with treeview, and i got basic things setup and
working.  but i was trying to setup a treeview that displays text and an
icon next to it on the left.  if i set the Pixbuf attribute of a
CellRendererPixbuf and the Text attribute of a CellRendererText and just
do store.AppendValues(""); -- it works but gives errors on the command
line while running.  so i am trying to figure out how to correctly do
this.  after trying for a while, i can't figure it out, so could anyone
help me and tell me how i could display a picture with the text by it?

my setup code is as follows:
public void SetupUI(){
  TreeStore store = new TreeStore(typeof(string), typeof(Pixbuf));
  treeview = new TreeView(store);
  CellRendererText ct = new CellRendererText();
  CellRendererPixbuf cb = new CellRendererPixbuf();
  treeview.HeadersVisible = false;
  TreeViewColumn column = new TreeViewColumn();
  column.PackStart(cb, false);
  column.PackStart(ct, true);
  column.AddAttribute(cb, "pixbuf", 0);
  column.AddAttribute(ct, "text", 1);

any help would be greatly appreciated.
ahmed el-helw <ahmedre@cc.gatech.edu>