diff options
Diffstat (limited to 'contrib/nvi/perl_scripts/tk.pl')
-rw-r--r-- | contrib/nvi/perl_scripts/tk.pl | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/contrib/nvi/perl_scripts/tk.pl b/contrib/nvi/perl_scripts/tk.pl new file mode 100644 index 0000000..f8d1bc0 --- /dev/null +++ b/contrib/nvi/perl_scripts/tk.pl @@ -0,0 +1,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; |