use Tk; use Tk::MDI; # implement MDI module use strict; my $MW = MainWindow->new; $MW->configure(-title => "Testfenster"); # # build menubar # my $menubar = $MW->Menu; my $menu_file = $menubar->cascade(-label => "~File", -tearoff => 0); my $menu_edit = $menubar->cascade(-label => "~Edit", -tearoff => 0); my $menu_help = $menubar->cascade(-label => "~Help", -tearoff => 0); $menu_file->command(-label => 'Exit', -command => sub { $MW->destroy() } ); $menu_edit->command(-label => 'does nothing'); $menu_help->command(-label => 'does nothing'); $MW->configure(-menu => $menubar); # # convert MainWindow into MDI window # "window" menu entry will be cascaded into existing menu structure # my $MDI = $MW->MDI(-style => 'win32', -background => 'white'); # # create two child windows # child windows can be treated as "normal" widgets # my $child1 = $MDI->add(-titletext => 'child window'); my $child2 = $MDI->add(-titletext => 'child window'); $child1->Button(-text => "does nothing")->pack; my $listbox = $child2->Listbox(-width => 200, -height => 100)->pack; $listbox->insert(1,'entry 1'); MainLoop;