Hi all.
Is a drop down menu supposed to be grey? I am teaching myself Perl/Tk programming and when I clicked on the title bar, I noticed that the menu item is 'greyed out'. Shouldn't the -background define the whole area?
#!/usr/bin/perl -w
use strict;
use Tk;
my $main = MainWindow->new();
$main->minsize( qw(450 250) );
$main->title("Look! My first Perl/Tk window.");
$main->configure(-background => 'Cyan' );
my $menu_bar = $main->Frame(-relief=>'groove',
-borderwidth => 3,
-background => 'purple',
)->pack(-side =>'top', -fill=>'x');
my $file_mb = $menu_bar->Menubutton(-text=>'File',
-background=>'purple',
-activebackground=>'cyan',
-foreground=>'white',
)->pack(-side =>'left');
my $file_mb2 = $menu_bar->Menubutton(-text=>'Help',
-background=>'purple',
-activebackground=>'cyan',
-foreground=>'white',
)->pack(-side =>'left');
$file_mb->command(-label=>'Exit',
-activebackground =>'magenta',
-command=>sub{$main->destroy});
$file_mb->separator();
MainLoop();
Thanks,
-Caitlin
Edit kudra,
2002-05-03
Added info after : in title
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
|
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.