in reply to forking in Tk and letting the dad alone deal with X stuff
I have yet to identify the difference between this snippet which works as intended and my code.
Probably the position of the mainloop is instrumental Here, the mainloop is after the my $fnm = $top->FileSelect()->Show(); and it works nevertheless
#! /usr/bin/perl use strict; use Socket; use Tk; use Tk::FileSelect; use FileHandle; my $top= MainWindow->new(); my $txtw = $top->Text->pack(); my $fnm = $top->FileSelect()->Show(); my $rd = new FileHandle; my $wr = new FileHandle; pipe $rd, $wr; if ( fork() ) { $top->fileevent($rd,'readable',\&insert); MainLoop; } else { open I,$fnm; print $wr $_ while($_=<I>); }
-- stefp -- check out TeXmacs wiki
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: forking in Tk and letting the dad alone deal with X stuff
by {NULE} (Hermit) on May 16, 2002 at 13:43 UTC | |
|
Re: Re: forking in Tk and letting the dad alone deal with X stuff
by perlplexer (Hermit) on May 16, 2002 at 12:57 UTC |