Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Am on Windows XP Home With ActiveState ActivePerl 5.8 Also use EnginSite Perl Editor LITE# Hello all # How do I colour the non-white area in the following white (leaving t +he labframe groove around it :) # 343 metres/meters per second at 20 use Tk; require Tk::LabFrame; use Tk::LabEntry; my $diswindow = MainWindow->new(-title => "Distances...",); $diswindow->minsize(qw(700 80)); $diswindow->maxsize(qw(700 80)); my $colour = 'white'; my $Temp : shared = 20; my $Temp3 : shared = ("\x{00B0}"); $diswindow->configure(-bg => $colour,); # labframe for distances my $f1 = $diswindow->LabFrame(-bg => $colour, -label => "Test distanc +es (in meters) and time taken to travel such at temperature (in \x{00 +B0}C).", -labelside => "acrosstop")->pack(-padx => 5, -pady => 7); # the \x{00B0} in the above prints the "UTF-8/**** encoded degree symb +ol" # check this again because it looks wrong ?!? # Abbrev of celsius is just C ??! # don't want left, rightk top or bottom want "acrosstop" # The acrosstop creates a grooved frame around the central frame and p +uts the label # near the northwest corner such that it appears to ``overwrite'' the +groove. # breakup f1 labframe # my $topframe4u=$f1->Frame(-bg => $colour,)->pack(-side=>'top', -fill +=>'x'); my $leftframe4u=$f1->Frame(-bg => $colour,)->pack(-side=>'left', -fill +=>'y'); my $rightframe4u=$f1->Frame(-bg => $colour,)->pack(-side=>'left', -fil +l=>'y'); my $rightframe4temp=$f1->Frame(-bg => $colour,)->pack(-side=>'left', - +fill=>'y'); my $a_to_b_distance = 343; # # Showing that distance: my $atbdis = $leftframe4u->LabEntry(-bg => $colour, -label => "a to b +distance =", -labelPack => [-side => "left"], -width => 10, -textvari +able => \$a_to_b_distance)->pack(-side => 'left', -padx => 5, -pady => 5); $atbdis->configure(-bg => $colour,); # The distance of $a to $b is then travelled by sound in say $time_a_t +o_b # showing the time: my $time_a_to_b = ($a_to_b_distance / 343 ); my $a_b = ("a to b is then travelled by sound in... "); my $wida = $rightframe4u->Label(-bg => $colour, -width => 49, -text => + $a_b . $time_a_to_b, )->pack(-side => 'left', -padx => 1, -pady => 5 +); # $Temp3 = ("\x{00B0}"); $say1 = ("when the tempreature is "); # showing the temp: my $wid = $rightframe4temp->Label(-bg => $colour, -width => 24, -text +=> $say1 . $Temp . $Temp3, )->pack(-side => 'left', -padx => 1, -pad +y => 5); MainLoop;
2005-11-28 Retitled by g0n, as per Monastery guidelines
Original title: 'Skin'
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Adding a Skin to a Tk widget
by zentara (Cardinal) on Nov 28, 2005 at 13:22 UTC | |
|
Re: Adding a Skin to a Tk widget
by Anonymous Monk on Nov 28, 2005 at 13:48 UTC | |
|
Re: Adding a Skin to a Tk widget
by Anonymous Monk on Nov 28, 2005 at 17:46 UTC | |
by thundergnat (Deacon) on Nov 28, 2005 at 21:11 UTC | |
by Anonymous Monk on Nov 29, 2005 at 13:33 UTC |