Re: [gtkmm] ListStore sorting and Gtk::TreeIter validity problems



On Sunday 01 August 2004 11:35, Samuel Abels wrote:

> I have now found out that the following code...
>
> void GtkBookList::remove_selected(void)
> {
>   Gtk::TreeIter iter = sortstore->convert_iter_to_child_iter(
>       get_selection()->get_selected());
>   if (!iter)
>     return;
>   Book* book = iter->get_value(columns.book);
>   printf("Book found: %s\n", book->get_title().c_str());
>   store->erase(iter);
> }
>
> ...does indeed remove the correct row, but then store->erase() also
> generates error messages:

I know you have now solved this, but one thought that this prompts is whether 
your problems may have been partly connected with using a Gtk::TreeModelSort 
object to wrap a Gtk::TreeSortable object to use with Gtk::ListStore.  
Gtk::ListStore is already sortable: it uses multiple inheritance and inherits 
from, amongst other things, Gtk::TreeSortable.

Chris.



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