Re: Gtk2::TreePath broken on Debian?



I thought paths were safe to carry around between changes, but iters
were the things that lasted only a short time?

Also, this code was working perfectly on FreeBSD, just not on Debian.
Did a rule about the life of a path change between the versions I
have? I'll have to see if the path within the foreach sub has the same
issues.

It turns out there's a whole heap of other errors going on in my newer
Debian version of Gtk2 that never occured on the older FreeBSD
version, some of which make no sense (latest is Gtk2::TreeStore->clear
sometimes silently die-ing - I just _love_ 'sometimes' errors....), so
at this point with so much affected code we're actually considering
just switching back.

MB

On 20 April 2010 05:01, Kevin Ryde <user42 zip com au> wrote:
Matthew Braid <ptkperl mdb id au> writes:

my $path = undef;
$mod->foreach(sub {
                my ($model, $tpath, $iter, $lookfor) = @_;
                return 0 if $model->get($iter, 1) != $lookfor;
                $path = $tpath;

Probably must $tpath->copy there, as a treepath object generally doesn't
survive beyond the call that created it.

I get a segfault at $path->to_string.

Sounds likely :-)

I assume $mod->get_iter($path) is masking

Or finding no such row for the first couple of (bad) indices and
stopping there.




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