[Gtk-sharp-list] TreeView context menu.
George Farris
farrisg@mala.bc.ca
19 Feb 2003 13:01:45 -0800
OK I think I now have a brain fart going on here. There is something
about this I just can't wrap my brain around. I don't know why. It's
some mental block (yes I'm slow). but what to do I do to print the value
of a selection. I have the following function:
private void book_selection_changed(object o, EventArgs args)
{
Gtk.TreeIter iter = new Gtk.TreeIter();
Gtk.TreeModel model = (o as TreeView).Model;
Value value = new Value ();
if (book.Selection.GetSelected(out model, ref iter))
{
model.GetValue(iter, 0, value);
}
Console.WriteLine("Selection value is {0}", xxxx);
}
How do I get xxxx to be the string in I selected in the list?
On Wed, 2003-02-19 at 17:01, Lee Mallabone wrote:
> On Wed, 2003-02-19 at 12:42, George Farris wrote:
> > Well actually I've gotten a bit further since I emailed the list I have
> > a function that looks like so:
> > ..snip..
> > if (book.Selection.GetSelected(out model, ref iter))
> > {
> > model.GetValue(iter, 1, value);
> > }
> > }
> >
> > I'm just not clear on the whole "value" thing yet. Any ideas?
>
> This is a bug in the C# wrapper. The value argument should be an 'out'
> parameter, but it's been wrapped as a normal 'in' parameter.
>
> I'd suggest opening a bug at bugzilla.ximian.com, otherwise I expect
> it'll eventually get fixed/reported in the API 'audit' that's slowly
> happening...
>
> Lee.
--