gator456 has asked for the wisdom of the Perl Monks concerning the following question:
I want to wrap some Tk around a UNIX text based program. The UNIX program takes input from STDIN as a command line and results are returned to STDOUT. (The UNIX program is TCL based and behaves very similiar to `tclsh`)
What I had in mind was to create a TK-Entry box for input, then feed that to the UNIX program. Then the UNIX program would feed its output to a TK-text box.
What would be the perl code to start the UNIX program and send data back and forth to it? Is it a PTTY?
If there are some examples out there, please let me know. I think the Tk would look like this:
#!/usr/bin/perl use Tk; require Tk::NoteBook; my $mw = MainWindow->new; $nb = $mw->NoteBook()->pack(-side => 'bottom', -expand => 1, -fill => +'both'); $entry = $mw->Entry()->pack(-side => 'bottom', -expand => 1, -fill => +'both'); $tab1 = $nb->add('tab1', -label => 'tab1'); $t1 = $tab1->Scrolled("Text")->pack(-expand => 1, -fill => 'both'); MainLoop;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Perl/Tk Unix Question
by zentara (Cardinal) on May 30, 2008 at 15:37 UTC | |
|
Re: Perl/Tk Unix Question
by pc88mxer (Vicar) on May 30, 2008 at 15:29 UTC | |
|
Re: Perl/Tk Unix Question
by psini (Deacon) on May 30, 2008 at 15:14 UTC |