Tk::MDI - Multiple Document Interface

Tk::MDI bietet ein Multiple Document Interface für Perl/Tk. Das ist eine Möglichkeit zur Darstellung mehrerer Dokumente innerhalb eines Hauptfensters bzw. MainWindow. Es stellt eine Alternative zum Tk::Notebook dar.

#!perl

use strict;
use warnings;
use Tk;
use Tk::MDI;

my $mw  = tkinit;
my $mdi = $mw->MDI(
	-style      => 'win32',
	-background => 'white',
);

my $child1 = $mdi->add;
my $text   = $child1->Text->pack;
$text->insert( 'end', "A text widget" );

my $child2 = $mdi->add( -titletext => 'Listbox Title' );
my $lb = $child2->Listbox->pack(-fill => 'x');
$lb->insert( 0, "A Listbox" );

my $child3 = $mdi->newWindow( -titlebg => 'white' );
my $c = $child3->Scrolled( 'Canvas', -scrollbars => 'se' )->pack;
$c->create( 'text', 50, 50, -text => "A Canvas" );

$mw->MainLoop;
exit(0);
Top