在菜单栏中,如果我点击一个选项,那么我可以打开同一个模块两次、三次等。但如果它已经打开,那么它不应该再次打开。知道怎么做吗?Perl/Tk
MainWindow
$mw = MainWindow->new;
$mw->configure(-menu => $menubar = $mw->Menu);
$bikes=$menubar->cascade(-label => '~Bikes');
$cars = $menubar->cascade(-label => '~Cars');
$cars->command(-label => 'Honda', -command=>\&honda_cars);
$cars->command(-label => 'Chevrolet',-command=>\&Chevrolet_cars);
$bikes->command(-label => 'Honda', -command=>\&honda_bikes);
$bikes->command(-label => 'Bajaj', -command=>\&bajaj_bikes);
现在,如果我单击雪佛兰,那么只要单击菜单栏中的选项,我就可以再次获得相同的窗口。我想检查它是否已经打开,然后它不应该再次打开。