Re: Autoupdating EntryCompletion (was Selectively trapping keypresses)
- From: "Jeffrey Ratcliffe" <jeffrey ratcliffe gmail com>
- To: muppet <scott asofyet org>
- Cc: gtk-perl-list gnome org
- Subject: Re: Autoupdating EntryCompletion (was Selectively trapping keypresses)
- Date: Tue, 17 Apr 2007 16:42:21 +0200
On 17/04/07, muppet <scott asofyet org> wrote:
I couldn't reproduce that after tinkering for just a few moments, but i think
i see it in the code...
Replace "one" with "twelve" twice, and during the second replacement,
the error comes.
Any change to a TreeModel invalidates existing TreeIters.
> $cmp_model -> signal_connect('row-inserted' => sub {
> my ($model, $path, $iter) = @_;
> my ($val) = $cmp_model->get($iter, 0);
> warn "inserted $val\n";
>
> # Weed out duplicates
> my $iter2 = $cmp_model->iter_next($iter);
> while ($iter2) {
> my ($val2) = $cmp_model->get($iter2, 0);
> warn "list $val2\n";
> if ($val eq $val2) {
> warn "removing $val2\n";
> $cmp_model->remove ($iter2);
> warn "removed $val2\n";
I can add a return statement here, as there will only ever one
duplicate, and then there are no problems with iters. But the error
still comes.
Jeff
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]