Re: Struggling with TreeModelFilter
- From: "Torsten Schönfeld" <kaffeetisch gmx de>
- To: gtk-perl-list gnome org
- Subject: Re: Struggling with TreeModelFilter
- Date: Mon, 22 May 2017 14:15:55 +0200
"Mike Martin" <mike redtux org uk>:
sub cell_edited {
my ($cell, $path_string, $new_text, $model1) = @_;
You're example code is not complete, but $path_string here most probably refers to the filtered model.
my ($model,$column)=@{$model1};
And $model is most likely the unfiltered model.
my $path = Gtk3::TreePath->new_from_string ($path_string);
Hence you probably need this here:
$path = $filter->convert_path_to_child_path ($path);
my $iter = $model->get_iter ($path);
my $gvalue = Glib::Object::Introspection::GValueWrapper->new (
'Glib::String', $new_text);
#$self->{stack}->child_set_property ($child, 'needs-attention', $gvalue);
$model->set_value ($iter, $column, $gvalue);
This should work as well:
$model->set ($iter, $column, $new_text)
}
-Torsten
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]