how about something like this ...
...
sub clicked {
system ( 'myscript.pl' );
}
my $top = MainWindow->new();
my $button = $top->Button (
-text => "click me",
-command => \&clicked
)->pack();
...
MainLoop();
| [reply] [d/l] |
Dear rbc, derby & Courage,
Thank you so much! Your suggestions totally helped me out.
| [reply] |
I suggest you to write independent GUI wrapper that will ask user for parameters, may be performs saving/restoring of values of previous sessions, an then pressing "process" will call your "command-line interface" program which will understand those options and will do the work.
Also, instead of just running another perl instance, it is possible to do 'script-name.pl';
I implemented several utilities at work using this way, and consider that as quite convenient way to do.
Courage, the Cowardly Dog
things, I do for love to perl... | [reply] [d/l] |
Dear Courage,
Thanks for your reply!
However, I'm extremely new to Perl & Tk, so I don't know how to write a wrapper. Are there properties in certain widgets that will allow me to return to the original program after the user presses the button?
Thanks again!
| [reply] |
perl -MTk -lwe "for(tkinit){$_->Button(-text=>'test',-command=>sub{pri
+nt'do anything you want here, i.e. call your favourite program'})->pa
+ck;$_->Text->pack};MainLoop"
OTOH there are quite a lot of examples of Tk programs here and there, so you can start using them right away.
Courage, the Cowardly Dog | [reply] [d/l] |
Not a lot to go on but you could
1. fork/exec or system the existing program.
2. with a little work possibly do, require or use the existing program
It really all depends on how you've structured the original script and how married you are to not changing it.
-derby | [reply] |