Re: How to implement custom interfaces in derived TreeModelSort ?
- From: Torsten Schoenfeld <torsten schoenfeld gmx de>
- To: gtk-perl-list gnome org
- Subject: Re: How to implement custom interfaces in derived TreeModelSort ?
- Date: Sun, 31 May 2020 08:36:30 +0200
On 30.05.20 22:17, Gaëtan Frenoy wrote:
I was doing:
my $model_sort = MyTreeModelSort->new_with_model($model);
while you created your own constructor !
After I changed the above line with:
my $model_sort = MyTreeModelSort->new(model => $model);
all suddenly worked as expected...
(see attached for the complete code)
They key difference is that the latter ends up in Glib::Object::new,
which is responsible for setting up the magic that associates the
underlying object with your class on the Perl and C level. If you call
new_with_model, this won't happen. Also, simply reblessing in Perl is
not sufficient either, because that doesn't do the C side of the
association.
-Torsten
[
Date Prev][Date Next] [
Thread Prev][Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]