File: tk.pl

package info (click to toggle)
nvi 1.79-20
  • links: PTS
  • area: main
  • in suites: woody
  • size: 5,384 kB
  • ctags: 3,767
  • sloc: ansic: 42,491; sh: 1,534; tcl: 1,124; makefile: 784; perl: 240; awk: 24; csh: 13
file content (20 lines) | stat: -rw-r--r-- 432 bytes parent folder | download | duplicates (29)
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;