in reply to Perl Tk User Interface & the rest of the Perl program

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...

Replies are listed 'Best First'.
Re: Re: Perl Tk User Interface & the rest of the Perl program
by Anonymous Monk on Aug 14, 2002 at 19:29 UTC
    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!
      when user presses a button, you can manage it to invoke a sub which, in turn, will do what I just said and return.

      Here is oneliner for Win32 that will demonstrate what I just said:

      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