an interesti ng perl program I wrote this morning late, funny stuff

R

Robin

use strict;
use Tk;
my ($a1, $a2, $a3, $a4, $a5, $a6);
my $m = new MainWindow ();
$m -> Dialog (-text=>"Copy color names to the clipboard") -> Show();
$m -> Label (-text=>" ", -background=>"purple") -> grid (my $c1
= $m -> Checkbutton (-variable=>\$a1) );
$m -> Label (-text=>" ", -background=>"blue") -> grid (my $c2 =
$m -> Checkbutton (-variable=>\$a2) );
$m -> Label (-text=>" ", -background=>"green") -> grid (my $c3 =
$m -> Checkbutton (-variable=>\$a3) );
$m -> Label (-text=>" ", -background=>"black") -> grid (my $c4 =
$m -> Checkbutton (-variable=>\$a4) );
$m -> Label (-text=>" ", -background=>"white") -> grid (my $c5 =
$m -> Checkbutton (-variable=>\$a5) );
$m -> Label (-text=>" ", -background=>"red") -> grid (my $c6 =
$m -> Checkbutton (-variable=>\$a6) );
$m -> Button (-background=>"lightblue", -command=>\&c, -text=>"Copy
color name to clipboard") -> grid ($m -> Label (-text=>"Great, thanks
for using me...", -background=>"black", -foreground=>"white"), $m->
Button (-text=>"Clear clipboard", -command=>\&cl) );
$m -> configure (-title=>"Cool color picker");
MainLoop();



sub c () {

if ($a1) {
$m -> clipboardAppend(" purple ");
}
if ($a2) {
$m -> clipboardAppend(" blue ");
}
if ($a3) {
$m -> clipboardAppend(" green ");
}
if ($a4) {
$m -> clipboardAppend(" black ");
}
if ($a5) {
$m -> clipboardAppend(" white ");
}
if ($a6) {
$m -> clipboardAppend(" red ");
}


}
sub cl () {
$m -> clipboardClean ();
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top