RE: Problems with data returned from Gtk2::SimpleList
- From: "Roderich Schupp (ext)" <Roderich Schupp ext BenQ com>
- To: "muppet" <scott asofyet org>, <gtk-perl-list gnome org>
- Subject: RE: Problems with data returned from Gtk2::SimpleList
- Date: Thu, 3 Aug 2006 17:39:39 +0200
I believe that he means evaluation of the tied SimpleList
data value may be
different in scalar versus array content.
Try
$image = Gtk2::Image->new_from_file (scalar
($slist->{data}{$i][0]));
Indeed, that work's. But is not your average
scalar-vs-list-context, because after
@data = $slist->{data}[$i][0]; # force list context on right
@data contains just one element. It works because
scalar() takes the magic away. I tried it with
the most simpleminded tied scalar:
package Foo;
sub TIESCALAR { my ($class, $val) = @_; return bless \$val, $class; }
sub FETCH { my ($self) = @_; print STDERR "FETCH($self)\n"; $$self; }
package main;
my $foo;
tie $foo, Foo => "some.png";
my $image = Gtk2::Image->new_from_file($foo);
Foo::FETCH doesn't get called at all.
Cheers, Roderich
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]