anjiro has asked for the wisdom of the Perl Monks concerning the following question:
package Tk::Foon; use base qw(Tk::Derived Tk::Label); Construct Tk::Widget 'Foon'; sub ClassInit { my($class, $mw) = @_; $class->SUPER::ClassInit($mw); } sub Populate { my($self, $args) = @_; $self->SUPER::Populate($args); $self->ConfigSpecs('DEFAULT' => [ 'SELF' ]); }
And some test code:
#!/usr/bin/perl -w use strict; use Tk; use Tk::Foon; my $mw = MainWindow->new; my $l = $mw->Foon(-background =>'blue', -foreground => 'red')->pack; $l->configure(-text => 'happy'); MainLoop;
Running this, I get the background of the label blue as requested, but the foreground appears black rather than red. Any ideas?
Thanks!
Daniel Ashbrook
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Tk widget derivation problems
by JamesNC (Chaplain) on Aug 02, 2003 at 20:39 UTC | |
by anjiro (Beadle) on Aug 03, 2003 at 00:20 UTC | |
|
Re: Tk widget derivation problems
by Anonymous Monk on Aug 02, 2003 at 15:33 UTC | |
by bobn (Chaplain) on Aug 02, 2003 at 16:01 UTC | |
|
Re: Tk widget derivation problems
by converter (Priest) on Aug 03, 2003 at 07:54 UTC | |
by anjiro (Beadle) on Aug 03, 2003 at 09:37 UTC | |
by JamesNC (Chaplain) on Aug 03, 2003 at 14:49 UTC |