summaryrefslogtreecommitdiffstats
path: root/contrib/nvi/perl_scripts/tk.pl
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/nvi/perl_scripts/tk.pl')
-rw-r--r--contrib/nvi/perl_scripts/tk.pl20
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;
OpenPOWER on IntegriCloud