Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Perl TK Menu Bar

Status
Not open for further replies.

clueo8

Programmer
Jun 13, 2005
47
US
I have a menu bar with code:
Code:
$main_win->configure(-menu => my $menubar = $main_win->Menu);
my $file = $menubar->cascade(-label => '~File');
$file->command(-label => 'Test', -command => \&test);
$file->command(-label => 'Exit', -command => \&exit);
How can I change the color from the standard windows grey to anything I want? I tried putting -background in there, but it never works correctly... And if I do get the menu bar color changed, how can I change the elements like roll over bg color to change when I select menu items...

Thanks!
 
This will answer some of your questions, but not the color for the menu bar itself.

Code:
use Tk;

$main_win = MainWindow->new;
$menubar = $main_win->Menu;
$main_win->configure(-menu => $menubar);
my $file = $menubar->cascade(-label => '~File');
$file->command(-label => 'Test', -command => \&test, -background => "#000099", -foreground => "#990000");
$file->command(-label => 'Exit', -command => \&exit, -background => "#990000", -foreground => "#000099", -activebackground => "#009900");
MainLoop;

sub test { print "TEST\n"; }


Michael Libeson
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top