Re: Invalid TreeStore Iterator
- From: Kevin Ryde <user42 zip com au>
- To: <list guenther-sohler net>
- Cc: gtk-perl-list gnome org
- Subject: Re: Invalid TreeStore Iterator
- Date: Fri, 16 Apr 2010 09:23:58 +1000
<list guenther-sohler net> writes:
$treeselection->selected_foreach (sub{
my ($model,$path,$iter) = _;
Generally path and iter objects passed to you in a foreach are only good
for as long as you're in the foreach. When the signal handler runs
later,
$param_dialog->signal_connect('response', sub
{
print "before\n";
$model->set($iter,0,"text");
The iter will be no good any more. There's a crib on that hidden under
"Memory Handling" in the Gtk2::api docs -- if anyone can possibly divine
that that affects iters in callbacks :-).
Without paying attention to what it's trying to do, maybe hold a
Gtk2::TreeRowReference to the interested row, or just a copy of the path
object, $path->copy, or similar to identify the place to later act on.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]