Resource for building custom models
I have a custom TreeView in which I want to implement both a filter and sorting functionality. Unfortunately Gtk2::TreeStore does not implement Gtk2::TreeModelFilter. Currently, I get around this by overriding the following routine in my custom TreeView. sub set_model { my ($self, $model) = @_; $self-{model} = $model; $self-{filter_model} = Gtk2::TreeModelFilter-new($model); $self-{filter_model}-set_visible_func(\_visible_func, $self); $self-{sort_model} = Gtk2::TreeModelSort-new($self-{filter_model}); $self-Gtk2::TreeView::set_model($self-{sort_model}); } I would like to create a custom model so I don't need to use this hack. I have looked around for information on this - but it is sparse - and that I do find is not all that informative. Does anyone know of a resource that I can use to learn how to do this? ___ gtk-perl-list mailing list gtk-perl-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-perl-list
Re: Resource for building custom models
Jeff Hallock wrote: I have a custom TreeView in which I want to implement both a filter and sorting functionality. Unfortunately Gtk2::TreeStore does not implement Gtk2::TreeModelFilter. Gtk2::TreeModelFilter is not an interface that objects can implement. Gtk2::TreeModelFilter is itself a Gtk2::TreeModel with the sole purpose of wrapping another model for the purpose of filtering. Similarly for Gtk2::TreeModelSort. Currently, I get around this by overriding the following routine in my custom TreeView. sub set_model { ... } I think that's exactly how Gtk2::TreeModelFilter and Gtk2::TreeModelSort are supposed to be used. I would like to create a custom model so I don't need to use this hack. I have looked around for information on this - but it is sparse - and that I do find is not all that informative. Does anyone know of a resource that I can use to learn how to do this? For implementing custom tree models, see `perldoc Gtk2::TreeModel' and http://scentric.net/tutorial/sec-custom-models.html. -- Bye, -Torsten ___ gtk-perl-list mailing list gtk-perl-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-perl-list
Re: delay in widget-sensitive
there's a long-standing bug that causes the visual update not to happen until you move out and come back in. http://bugzilla.gnome.org/show_bug.cgi?id=56070 Opened by Manuel Clos (reporter, points: 14) 2001-06-11 18:43 UTC . OMG. After celebrating the 10 years birthday of GNOME, will we have to celebrate the 10 years birthday of this bug ? ;-) , 25 duplicates. , This trivial approach for solving the problem was rejected since gtk_widget_get_pointer() causes an additional X server roundtrip. So agreed: The patch isn't perfect. It is a hack, but it solves the problem. Well, and this is were the social aspect of the problem kicks in: Rejecting a working solution 'cause of its uglyness, without providing a better solution within years, clearly is a social problem. It's the social aspect, not the technical one, that qualifies this bug as BLOCKER - IMHO. --Sergei. ___ gtk-perl-list mailing list gtk-perl-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-perl-list