Re: subclassing problem...



Bruno wrote:

our @ISA = qw(Gtk2::TextBuffer);
sub new 
{
  my ($fs,$hashref,$tagtable) = @_;
  my $obj_ref;
  $obj_ref = Gtk2::TextBuffer->new($tagtable);
  #$obj_ref = SUPER::new($tagtable);

  bless $obj_ref, "POE::Helper::LogView";

  return $obj_ref;
}# sub new 

now like this it works, but its highly unsatisfactory that the version
with SUPER doesn't.... anyone care to explain me why?

I used

        use base 'Gtk2::TextView';

        sub new {
                my $package = shift;
                my $self = $package->SUPER::new;
                bless($self, $package);
                return $self;
        }

for Gtk2::PodViewer. ISTR that I lifted it from a code snippet from
Ross. Seems to work fine - why not give it a try?

Gavin.


-- 
Gavin Brown
e: gavin brown uk com
w: http://jodrell.net/
PGP/GPG key ID: 891D8FCA




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