[Gtk-sharp-list] Re: [Gtk-sharp-list] gtk_tree_selection_get_selected_rows() custom or generated?

George Farris farrisg@mala.bc.ca
21 Feb 2003 12:03:32 -0800

On Fri, 2003-02-21 at 16:08, Lee Mallabone wrote:
> On Fri, 2003-02-21 at 13:35, George Farris wrote:
> > Ah I see,  I tried SelectedForeach but I did the following and it
> > complained:
> >   selectionInfo.SelectedForeach(recordRow);
> > 
> > One would think you would be able to do this without the
> > "new TreeSelectionForeachFunc" call.
> That's caught me out once or twice before... It's necessary because of
> the way C# treats delegates, (ie. function pointers).
> > The other problem I had was that when Multiple selections were enabled
> > the "Changed" signal that called GetSelected(out model, ref iter) died
> > because GetSelected does work with Multiple selections.
> How did it die? Can you be more specific about what it should do? Do you think it should throw an exception of some kind? (I know that's the sort of thing that would be desirable in Java-land, not so sure about C#).

Actually I went back and reverted to the code I had before and the
application didn't die but I got an error that 
gtk_tree_selection_get_selected failed which actually is described in
the gtk docs:

gtk_tree_selection_get_selected ()
gboolean    gtk_tree_selection_get_selected (GtkTreeSelection *selection,
                                             GtkTreeModel **model,
                                             GtkTreeIter *iter);

Sets iter to the currently selected node if selection is set to
just want to test if selection has any selected nodes. model is filled
with the current model as a convenience. This function will not work if
you use selection is GTK_SELECTION_MULTIPLE.

> -- 
> George Farris <farrisg@mala.bc.ca>