Skip Menu |

This queue is for tickets about the Tk CPAN distribution.

Report information
The Basics
Id: 61564
Status: open
Priority: 0/
Queue: Tk

People
Owner: Nobody in particular
Requestors: greg.jahn [...] faa.gov
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 804.029
Fixed in: (no value)



Subject: Tk::Menu Options Problem
I can not seem to get the options to work on the Menu widget using the following command: $menu = $parent->Menu(?options?); Module: Tk-804.029 Perl Version: 5.10.0 (ActiveState) Operating System: Windows XP, SP3. I'm trying to create a simple menu at the top of my MainWindow, except I'd like it to have a different font and background color. I've added my options to the Menu itself but this seems to have no effect on the menu. I can add the option to the individual menu items and this works, unfortunately you can not add options to a "separator" item (that part is documented on CPAN). Code: ------------------------------------------------------- my $mw = MainWindow->new(); my $menuBar = $mw->Menu( -font=> "{Sans} 14 bold", -background=> 'green' ); $mw->configure( -menu=> $menuBar ); my $fileMenu = $menuBar->cascade( -label=> "File" ); $fileMenu->command( -label=> 'Open' ); $fileMenu->command( -label=> 'Save', -font=> "{Sans} 14 bold", -background=> 'green' ); $fileMenu->separator; $fileMenu->command( -label=> 'Exit', -command=> \&exit ); MainLoop(); ------------------------------------------------------- I've checked on a couple of Perl forums and was told that the options work fine on Unix or Mac environments. Thank you for your time.
Subject: menu.pl
#!perl -w use strict; use warnings; use Tk; my $mw = MainWindow->new(); my $menuBar = $mw->Menu( -font=> "{Sans} 14 bold", -background=> 'green' ); $mw->configure( -menu=> $menuBar ); my $fileMenu = $menuBar->cascade( -label=> "File" ); $fileMenu->command( -label=> 'Open' ); $fileMenu->command( -label=> 'Save', -font=> "{Sans} 14 bold", -background=> 'green' ); $fileMenu->separator; $fileMenu->command( -label=> 'Exit', -command=> \&exit ); MainLoop(); 1; __END__
On 2010-09-22 08:55:33, AirForce1 wrote: Show quoted text
> I can not seem to get the options to work on the Menu widget using the > following command: $menu = $parent->Menu(?options?); > > Module: Tk-804.029 > Perl Version: 5.10.0 (ActiveState) > Operating System: Windows XP, SP3. > > I'm trying to create a simple menu at the top of my MainWindow, except > I'd like it to have a different font and background color. I've added
my Show quoted text
> options to the Menu itself but this seems to have no effect on the
menu. Show quoted text
> I can add the option to the individual menu items and this works, > unfortunately you can not add options to a "separator" item (that part > is documented on CPAN). > > Code:
[...] Show quoted text
> ------------------------------------------------------- > > I've checked on a couple of Perl forums and was told that the options > work fine on Unix or Mac environments. > > Thank you for your time.
It seems that Tcl/Tk 8.5 has the same problem. So there's little hope that it will be fixed in Perl/Tk until it has some solution in "original" Tk. Regards, Slaven
Subject: Re: [rt.cpan.org #61564] Tk::Menu Options Problem
Date: Fri, 1 Oct 2010 06:38:59 -0500
To: bug-Tk [...] rt.cpan.org
From: greg.jahn [...] faa.gov
Slaven, Thank you for the looking into this and your quick reply. I guess this means that using Tkx or wxPerl wont help either will it? I believe they are also hooked to Tcl/Tk. Greg Jahn ATC Automation ------------------------------------------------------------------- North Texas OSF, AJT-1476 Chicago Office 847-608-5765 - Office Phone 847-637-6066 - Cell Phone 847-608-5886 - Fax 1-866-432-2622 - Service Area Help Desk ------------------------------------------------------------------- From: "Slaven_Rezic via RT" <bug-Tk@rt.cpan.org> To: Greg Jahn/AGL/FAA@FAA Date: 09/26/2010 02:31 PM Subject: [rt.cpan.org #61564] Tk::Menu Options Problem <URL: https://rt.cpan.org/Ticket/Display.html?id=61564 > On 2010-09-22 08:55:33, AirForce1 wrote: Show quoted text
> I can not seem to get the options to work on the Menu widget using the > following command: $menu = $parent->Menu(?options?); > > Module: Tk-804.029 > Perl Version: 5.10.0 (ActiveState) > Operating System: Windows XP, SP3. > > I'm trying to create a simple menu at the top of my MainWindow, except > I'd like it to have a different font and background color. I've added
my Show quoted text
> options to the Menu itself but this seems to have no effect on the
menu. Show quoted text
> I can add the option to the individual menu items and this works, > unfortunately you can not add options to a "separator" item (that part > is documented on CPAN). > > Code:
[...] Show quoted text
> ------------------------------------------------------- > > I've checked on a couple of Perl forums and was told that the options > work fine on Unix or Mac environments. > > Thank you for your time.
It seems that Tcl/Tk 8.5 has the same problem. So there's little hope that it will be fixed in Perl/Tk until it has some solution in "original" Tk. Regards, Slaven