Re: a TreeModel that's sortable and filterable?



Juan A. Moreno wrote:


2008/6/16 José Alburquerque <jaalburquerque cox net <mailto:jaalburquerque cox net>>:


    That's really strange.  Just out of curiosity,  I  modified  the
    ListStore example found here
    <http://www.gtkmm.org/docs/gtkmm-2.4/examples/book/treeview/list/>
    with the attached patch to sort its rows and use a TreeModelFilter
    with the ListStore as its child to exclude the row with id 4 and
    it works fine.  Would you be able to do something similar?


The patched example work fine, but try to add this two lines and then make click in the id column: for(guint i = 0; i < 2; i++)
  {
    Gtk::TreeView::Column* pColumn = m_TreeView.get_column(i);
    pColumn->set_reorderable();
  }

 +  pColumn = m_TreeView.get_column(0);
 +  pColumn->set_sort_column(m_Columns.m_col_id);

I see. The problem arises from the fact that the functions in gtk+ that produce the warnings expect to work with a GtkTreeSortable (which GtkListStore implements but GtkModelFilter does not) when in fact they get a GtkTreeModelFilter which does not directly implement GtkTreeSortble thus the warnings. Now I understand. Thanks for clearing this up.

--
José Alburquerque
jaalburquerque cox net



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