Re: GTKTreeView Question.



On Wed, Jul 16, 2003 at 03:36:55PM -0700, Harring Figueiredo wrote:

  (Sorry for the previous post with the wrong subject header.)


  Second question: How can I delete all the selected rows from a treeview.
Calling the foreach func causes an error because when the row is deleted it
renders the model invalid.

I ran into this problem just the other day.  My solution was to sort the
selected paths and then delete them from last to first. (It just occured to
me that my paths were probably already sorted.)

But the API docs suggest another solution:

gtk_tree_selection_get_selected_rows ()

GList*      gtk_tree_selection_get_selected_rows
                                            (GtkTreeSelection *selection,
          GtkTreeModel **model);
          
          Creates a list of path of all selected rows.    
          
========> Additionally, if you
are planning on modifying the model after calling this function, you may
want to convert the returned list into a list of GtkTreeRowReferences. To do
this, you can use gtk_tree_row_reference_new_proxy(). <=======

Dave Cook

Dave Cook



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]