AirForce1 has asked for the wisdom of the Perl Monks concerning the following question:

I hope this is something silly that i've overlooked. I just want a simple menu at the top of my MainWindow, except I'd like it to have a boarder and a different font and background color. As you can see from the code, I've added my options to the Menu itself but this seems to have no effect on the menu. Can someone please tell me what I'm doing wrong?

#!perl -w use strict; use warnings; use Tk; my $mw = MainWindow->new(); my $menubar = $mw->Menu( -borderwidth=> 2, -relief=> "groove", -font=> + "{Sans} 14 bold", -background=> 'white' ); $mw->configure( -menu=> $menubar ); my $fileMenu = $menubar->cascade( -label=> "~File", -tearoff => 0 ); $fileMenu->command( -label=> 'E~xit', -command=> \&exit ); MainLoop();

Replies are listed 'Best First'.
Re: Tk Menu Options
by stefbv (Priest) on Sep 10, 2010 at 17:44 UTC

    It works, on my GNU/Linux box.

    Regards, Stefan

    Update: using Perl v5.10.0, Tk: 804.028_502

Re: Tk Menu Options
by BrimBorium (Friar) on Sep 11, 2010 at 11:47 UTC

    It works on Mac OS X 10.5.8, perl v5.8.8. Which OS/perl are you using ?

      I would guess Windows, since I can replicate his claim on my WinXP-perl5.10.1 machine. The menu is the usual black-on-gray.

      "Principle of Least Astonishment: Any language that doesn’t occasionally surprise the novice will pay for it by continually surprising the expert..

        I probably should have included that bit of info. I am run Perl 5.10 on a WinXP machine.