[Gtk-sharp-list] Problems with Gtk.TreeView.

Erik Bågfors erik@bagfors.nu
10 Jun 2003 10:12:41 +0200


Hello!

First of all I'd like to say how nice gtk-sharp and mono in general
are.  I really don't understand why anyone would write their
applications in c anymore (well, I had a hard time understanding that
before as well :) ). Monodoc is a great tool that shows lot's of promise

My problem is that I have a TreeView in which I have a ListStore. Adding
values and so on is not a problem. My problem comes when I try to set
the background or foreground color of a line in that TreeView. 
I know how to do it in c but I cannot figure out how to do it in c# with
gtk-sharp.  In c I use
 gtk_tree_view_insert_column_with_attributes and gtk_list_store_set to
do that but I cannot find those methods in gtk-sharp.

In CellRendererText I can find some methods about colors but it seams
like that's only for the everything that that renderer renders and not
for single cells.

Can anyone tell me how to do this?


Another thing,
Sometimes you can really feel that gtk-sharp is a wrapper over something
originally written in c. For example when I have to use GLib.  For
example the following code:

ListStore store = new ListStore((int)TypeFundamentals.TypeString,
                           (int)TypeFundamentals.TypeString);
TreeIter iter = new TreeIter();
store.Append(out iter)
store.SetValue(iter, 0, new GLib.Value("TEST1")); 

Why should I have to care about GLib.Value here? I should be able to
just say
store.SetValue(iter,0,"TEST1");

The same goes for  TreeIter, why should I need that?  I should be able
to do
store.SetValue(0,"test1");
or better.
store.AddValue("test1");

At least that's what feels natural to me but I know next to nothing
about gtk+ and my c# skills are quite young :)

Keep up the good work!

Regards,
Erik
-- 
erik@bagfors.nu
fingerprint: 6666 A85B 95D3 D26B 296B 6C60 4F32 2C0B 693D 6E32