use Tk;
$main=MainWindow->new;
$menubar=$main->Frame->pack(-side=>'top',-fill=>'x');
$ragimenu= $menubar->Menubutton(-text=>'Ragi')->pack(-side=>'left');
$ragimenu->command(-label=>'History',-command=>\&history);
$searchbar=$menubar->Menubutton(-text=>'Search')->pack(-side=>'left');
$searchbar->command(-label=>'Literature search',-command=>\&literature);
$searchbar->command(-label=>'Genome search',-command=>\&genome);
sub history
{
$test=$main->Entry->pack();
$ragimenu->Menubutton(-state=>'disabled');
}
MainLoop;
i have tried by placing the $ragimenu->Menubutton(-state=>'disabled');
but that to does't works it still active
Comment on Re^2: how to disable a menuitem at runtime
Unfortunately I can't install Tk.pm in the office, so I am flying blind here. But the next thing I would try is moving that line into the main loop, instead of in the history subroutine.