#!/usr/bin/perl use strict; use warnings; use Tk; pipe(RDR,WTR); if (fork == 0) { close WTR; chomp(my $id = scalar ); close RDR; my $mw2 = MainWindow->new(-use => $id); $mw2->Label(-text => "Das andere Fenster")->pack(); MainLoop(); CORE::exit(); } close RDR; my $mw = new MainWindow; $mw->Label(-text => "Hier kommt das eingebettete Fenster:")->pack(); my $f = $mw->Frame(-container => 1)->pack(); my $id = $f->id; $mw->update; # wichtig, Fenster muss gemappt sein! print WTR "$id\n"; close WTR; MainLoop();