xref: /minix3/external/bsd/nvi/dist/perl_scripts/tk.pl (revision 84d9c625bfea59e274550651111ae9edfdc40fbd)
1*84d9c625SLionel Sambuc# make sure every subprocess has it's exit and that the main one
2*84d9c625SLionel Sambuc# hasn't
3*84d9c625SLionel Sambucsub fun {
4*84d9c625SLionel Sambuc    unless ($pid = fork) {
5*84d9c625SLionel Sambuc        unless (fork) {
6*84d9c625SLionel Sambuc            use Tk;
7*84d9c625SLionel Sambuc            $MW = MainWindow->new;
8*84d9c625SLionel Sambuc            $hello = $MW->Button(
9*84d9c625SLionel Sambuc                -text    => 'Hello, world',
10*84d9c625SLionel Sambuc                -command => sub {exit;},
11*84d9c625SLionel Sambuc            );
12*84d9c625SLionel Sambuc            $hello->pack;
13*84d9c625SLionel Sambuc            MainLoop;
14*84d9c625SLionel Sambuc        }
15*84d9c625SLionel Sambuc        exit 0;
16*84d9c625SLionel Sambuc    }
17*84d9c625SLionel Sambuc    waitpid($pid, 0);
18*84d9c625SLionel Sambuc}
19*84d9c625SLionel Sambuc
20*84d9c625SLionel Sambuc1;
21