[Gtk-sharp-list] TreeView Model and GetIter/GetValue

Rodolfo Campero rodolfo.campero at gmail.com
Wed Jul 6 08:49:38 EDT 2005


On 7/6/05, Rob Hudson <rob at euglug.net> wrote:
> Hello,
> I'm new to the list and was inspired by Nat's screencast on how easy it
> looked using Glade and Gtk# so I'm attempting a small app.
> I'm getting an error when I try to get a handle on the model used in the
> TreeView...
> Main.cs(77) error CS0165: Use of unassigned local variable `recipetree'
> Main.cs(78) error CS0165: Use of unassigned local variable `m'
> Main.cs(79) error CS0029: Cannot convert implicitly from `object' to
> `string'
> There's other errors but I can't seem to get past the error on line 77.

Try replacing:
         [Widget] Gtk.TreeView recipetree;
         [Widget] Gtk.TreeView recipetree = null;

                 string col0 = m.GetValue(iter, 0);
                 string col0 = (string)m.GetValue(iter, 0);

>   The variable recipetree is accessible in my MainClass constructor
> where I've used it to load values into the tree using AppendColumn(...).
> Any help would be appreciated.
I hope this helps.
Happy hacking,

More information about the Gtk-sharp-list mailing list