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); sub history { $test=$main->Entry->pack(); $ragimenu->configure(-state=>disabled); } MainLoop;