in reply to Setting Standard options for Tk widgets

use kids and iterate through them...
use Tk; my $mw = tkinit(-bg,'gray'); my $btn1 = $mw->Button(-text, "Hello There")->pack; my $btn1 = $mw->Button(-text, "Button 2")->pack; my $text = $mw->Text(-width, 40,-height, 5)->pack; my $super = ref $button; @kids = $mw->children; print @kids; foreach(@kids){ if(/Tk::Button/){ $_->configure(-bg, 'green'); } if(/Tk::Text/){ $_->configure(-bg, 'yellow'); } } MainLoop;
JamesNC

Replies are listed 'Best First'.
Re: Re: Setting Standard options for Tk widgets
by batkins (Chaplain) on Jun 09, 2003 at 01:01 UTC
    i'm looking more for a way to specify in advance what the options should be....