Re: subclass, custom widget



Ross McFarland said:
sub show
{
      my $self = shift;
      $self->{label}->show;
      $self->{entry}->show;
      $self->{button}->show;
        $self->SUPER::show;
}

typically when creating a composite widget like this, you'll show everything
*but* the toplevel widget as you create it, so that overriding show like this
isn't necessary.

another reason not to override show() is that it will not be called from C,
because only perl knows about it.  ;-)

Glib::Object::Subclass is supposed to make it possible to override methods
properly, but it's currently broken except for signals you create yourself. 
that's on my to-be-fixed list.

besides, if you *really* need to do something on show (such as load text into
the Entry) there's the show signal for that.

-- 
muppet <scott at asofyet dot org>



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