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

Re: GtkTreeModelSort + GtkTreeModelFilter



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

muppet wrote:

> Well, technically, TreeSortable is an interface that you can  implement,
> but TreeModelSort and TreeModelFilter are actual objects  that act as
> proxy models.  The TreeModelSort or TreeModelFilter is a  real object,
> but doesn't hold any data of its own.
> 
>> Actually for the programm i want to code those functionalities  would
>> be prefect. But not GtkTreeModelSort or GtkTreeModelFilter, i  would
>> like to use both.
>> But well, i cannot use both, i can use one or the other i think.
> 
> 
> Sure you can.  See attached example, modelmodelmodel.pl...  a sorted 
> and filtered list.  That's probably a rather heavyweight way to do  it,
> but it is at least possible.
> 

it doesn't work if you try to use a custom sort compare function.
TreeModelSort passes the underlying TreeModelFilter model to the compare
function. which doesn't provide the get_sort_column_id method.

my $sort_func = sub {
	my ($model,$a,$b) = @_;
	my ($sort_column_id,$order) = $model->get_sort_column_id;
...
}




- --
Jens Luedicke
web: http://perldude.de

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFDCwgjiCvkc4H0gTERAqlmAJ4nqFEJXfzoMl9oyVt+1f84hoKBzgCg3sYv
mx7ARi1IijfVVAjoNHEEmt8=
=oEIq
-----END PGP SIGNATURE-----



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