summaryrefslogtreecommitdiffstats
path: root/contrib/nvi/perl_scripts/tk.pl
blob: f8d1bc068df3d3a4b52c82d0610b918a401f8bb8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# make sure every subprocess has it's exit and that the main one
# hasn't
sub fun {
    unless ($pid = fork) {
        unless (fork) {
            use Tk;
            $MW = MainWindow->new;
            $hello = $MW->Button(
                -text    => 'Hello, world',
                -command => sub {exit;},
            );
            $hello->pack;
            MainLoop;
        }
        exit 0;
    }
    waitpid($pid, 0);
}

1;
OpenPOWER on IntegriCloud