Re: [pygtk] hide certain rows in treeview
Hi, Looks like version 2.4 is planned for release on November 1st. I'll wait a bit before trying to implement my own filter. Thanks! ~ Yang On Thu, 2003-10-09 at 11:10, David M. Cook wrote: > On Thu, Oct 09, 2003 at 10:43:54AM -0700, Yang Zheng wrote: > > > Is it possible to not show certain rows in a treeview that is attached > > to a treestore? I know you can display only certain columns, but what > > if there are some rows in a treestore structure that I do not want to be > > displayed? Can I set a flag and have it skipped? > > There's no way to do this currently without copying to another treestore. > gtk 2.4 will have a "FilteredTreeModel" that does this. > > http://www.gtk.org/plan/2.4/ > > Dave Cook > ___ > pygtk mailing list [EMAIL PROTECTED] > http://www.daa.com.au/mailman/listinfo/pygtk > Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/ ___ pygtk mailing list [EMAIL PROTECTED] http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
Re: [pygtk] Creating a sortable model derived from GenericTreeModel
Gustavo J. A. M. Carneiro wrote: You should try keeping your tree model intact, then create a gtk.TreeModelSort object, wrapping your model, then use the gtk.TreeModelSort as model for the tree view. See this: http://www.moeraki.com/pygtkreference/pygtk2reference/class-gtktreemodelsort.html I may be misunderstanding this. I took the treemodel.py example from the pygtk distribution and changed it from: model = MyTreeModel() tree_view = gtk.TreeView(model) To: model = MyTreeModel() sort_model = gtk.TreeModelSort(model) tree_view = gtk.TreeView(sort_model) When I run it, I get: ** (treemodel.py:16851): CRITICAL **: file pygtktreemodel.c: line 499 (pygtk_generic_tree_model_iter_n_children): assertion `iter != NULL' failed (treemodel.py:16851): Gtk-CRITICAL **: file gtktreemodelsort.c: line 2146 (gtk_tree_model_sort_build_level): assertion `length > 0' failed And the test case now fails to work. Don Allingham ___ pygtk mailing list [EMAIL PROTECTED] http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
Re: [pygtk] Creating a sortable model derived from GenericTreeModel
A Seg, 2003-10-20 às 19:38, Don Allingham escreveu: > I've been trying to develop my own list model for a gtk.TreeView. The ListStore's > performance is significantly slower that I can accept (I have thousands of entries, > and it can take longer than a minute to load). I've been able to create my own class > derived from gtk.GenericTreeModel, and it has proved to be at least an order of > magnitude faster. The problem I am encountering is that I cannot figure out how > to add column sorting. All the examples I've been able to find are static (data is > never added or deleted) and non-sortable > > If I make a column sortable on the TreeView (column.set_sort_column_id(0)), and it > is clicked, I get the error: > > (model.py:16538): Gtk-CRITICAL **: file gtktreesortable.c: line 107 > (gtk_tree_sortable_get_sort_column_id): assertion `GTK_IS_TREE_SORTABLE (sortable)' > failed > > The class, derived from GenericTreeModel, does not have the set_sort_column_id() > method that the TreeStore and ListStore classes have. This method is a member of > the TreeSortable class, which GenericTreeModel is not derived from > > I've tried to make my class inherit from the gtk.TreeSortable class (similar to the > TreeStore class): > > class MyTreeModel(gtk.GenericTreeModel, gtk.TreeSortable): > > And I get the error: > > Traceback (most recent call last): > File "model.py", line 6, in ? > class MyTreeModel(gtk.GenericTreeModel,gtk.TreeSortable): > TypeError: multiple bases have instance lay-out conflict > > I think I am missing something pretty basic here. Does anyone know what I am > doing wrong? You should try keeping your tree model intact, then create a gtk.TreeModelSort object, wrapping your model, then use the gtk.TreeModelSort as model for the tree view. See this: http://www.moeraki.com/pygtkreference/pygtk2reference/class-gtktreemodelsort.html > > Thanks, > Don Allingham > > > > ___ > pygtk mailing list [EMAIL PROTECTED] > http://www.daa.com.au/mailman/listinfo/pygtk > Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/ -- Gustavo J. A. M. Carneiro <[EMAIL PROTECTED]> <[EMAIL PROTECTED]> ___ pygtk mailing list [EMAIL PROTECTED] http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
[pygtk] Creating a sortable model derived from GenericTreeModel
I've been trying to develop my own list model for a gtk.TreeView. The ListStore's performance is significantly slower that I can accept (I have thousands of entries, and it can take longer than a minute to load). I've been able to create my own class derived from gtk.GenericTreeModel, and it has proved to be at least an order of magnitude faster. The problem I am encountering is that I cannot figure out how to add column sorting. All the examples I've been able to find are static (data is never added or deleted) and non-sortable If I make a column sortable on the TreeView (column.set_sort_column_id(0)), and it is clicked, I get the error: (model.py:16538): Gtk-CRITICAL **: file gtktreesortable.c: line 107 (gtk_tree_sortable_get_sort_column_id): assertion `GTK_IS_TREE_SORTABLE (sortable)' failed The class, derived from GenericTreeModel, does not have the set_sort_column_id() method that the TreeStore and ListStore classes have. This method is a member of the TreeSortable class, which GenericTreeModel is not derived from I've tried to make my class inherit from the gtk.TreeSortable class (similar to the TreeStore class): class MyTreeModel(gtk.GenericTreeModel, gtk.TreeSortable): And I get the error: Traceback (most recent call last): File "model.py", line 6, in ? class MyTreeModel(gtk.GenericTreeModel,gtk.TreeSortable): TypeError: multiple bases have instance lay-out conflict I think I am missing something pretty basic here. Does anyone know what I am doing wrong? Thanks, Don Allingham ___ pygtk mailing list [EMAIL PROTECTED] http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/