#!/usr/bin/perl -- use strict; use warnings; use Tk; Main( @ARGV ); exit( 0 ); sub Main { my $mw = tkinit(); my $nb = $mw->NoteBook( -backpagecolor => 'red',)->pack(qw/-expand 1 -fill both /); Colors($nb); $mw->geometry("200x200+200+200"); ## $mw->WidgetDump; $mw->MainLoop; } sub Colors { my( $nb ) = @_; my @color = qw[ pink maroon green OliveDrab4 PaleVioletRed3 RosyBrown2 PeachPuff4 WhiteSmoke azure3 chartreuse1 coral3 gold1 firebrick4 linen salmon4 tomato2 ]; for my $red( @color ){ my $frame = $nb->add( $red, -label => $red, ); my $emraf = $frame->Scrolled('Pane', -background => $red)->pack(qw/ -expand 1 -fill both /); $emraf->Button( -text => $_, )->pack( -side => (qw/ left right top bottom/)[rand 4] ) for @color; } }