in reply to Tk widget derivation problems

Based on these four lines, you aren't picking up the whole list, just the first element.

my($class, $mw) = @_; $class->SUPER::ClassInit($mw); my($self, $args) = @_; $self->SUPER::Populate($args);
Try:
my($class, @mw) = @_; $class->SUPER::ClassInit(@mw); my($self, @args) = @_; $self->SUPER::Populate(@args);

Replies are listed 'Best First'.
Re: Re: Tk widget derivation problems
by bobn (Chaplain) on Aug 02, 2003 at 16:01 UTC

    $arg is a hashref to the aruments, as shown with Data::Dumper

    sub Populate { my($self, $args) = @_; print Dumper($args); $self->SUPER::Populate($args); $self->ConfigSpecs('DEFAULT' => [ 'SELF' ]); }
    which prints:
    $VAR1 = { '-background' => 'blue', '-foreground' => 'red' };

    Also, changing the order of background and foreground has no effect. It seems that something is swallowing -foreground before it gets to the Label in the derived widget, since a Label given the same arguments has the expected effect. Perhaps configuring the Label individually inside Foon might work.

    --Bob Niederman, http://bob-n.com