For Programmers: Free Programming Magazines  


Home > Archive > PerlTk > September 2004 > Menu selects first entry by default









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Menu selects first entry by default
Shiri Shem-Tov

2004-09-02, 3:58 pm

Hello,

I run the following menu example:


my $mw = MainWindow->new;
$mw->title('Menubutton');
$menub = $mw->Menubutton(-text=> "Menubuton", -tearoff=> 0)->pack();

$menu1 = $menub->menu->Menu;
foreach (qw/one two three/) {
$menu1->add('command', -label => $_);
}

$menu2 = $menub->menu->Menu;
foreach (qw/A B C/) {
$menu2->radiobutton(-label => $_);
}

$menub->cascade(-label=> "Numbers");
$menub->cascade(-label=> "Letters");

$menub->entryconfigure("Numbers", -menu=> $menu1);
$menub->entryconfigure("Letters", -menu=> $menu2);

MainLoop;


When clicking on the menu button - the menu is opened, and the first
entry ("Numbers") is selected by default. The result is that "Numbers"
menu is also opened by default.

I use Tk-804.027 (on Solaris). I tried to run it with Tk-4.0, and
there "Numbers" menu was not opened by default.
I also tried to run Tk-804.027 on PC, and there it also looked ok
("Numbers" menu was not opened by default).

Is this a bug, a feature? Is there a way to control this?
Thanks,
Shiri.
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com