RE: Problems with data returned from Gtk2::SimpleList



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]