# from Huub Peters
# on Friday 18 July 2008 00:07:

>When you install it yourself you get the wxperl interpreter which you
>already mentioned.

And (IIRC) this is really nothing more than a perl interpreter sitting 
inside an appbundle.

>after launching the GUI does not get the focus.

To accept GUI input *at all*, it has to be in an appbundle.

To get focus when launched from the command-line, it has to be run via 
the `open` utility.

This has its own set of quirks in that:

  1. argv will not arrive via `open` - you have to register a file-type 
(or something) and call open on that file to get the app to launch with 
a file.  This also ties-in to their scheme of having only one running 
instance per application.

  2. The working directory will be '/'.  The `open` utility connects to 
something outside of your shell, so (IIRC) the process will not be a 
child of your shell process.  (Either that, or `open` is forking and 
detaching.)

  3. Because it detached, you have to read your STDERR/STDOUT in 
the "error console".

What this means for wxperl is that `open myapp.pl` isn't really an 
option.

I did a fair bit of playing with this issue to try to get to a point 
where launching a GUI app from the console would be analogous to Linux 
in terms of focus and staying connected to the shell.  Someone might 
feel like running with this -- I personally found that my frustrations 
were greatly decreased by not using a mac.

http://scratchcomputing.com/svn/Module-Build-Plugins-MacBundle/trunk/demos/mrsperl/bin/

--Eric
-- 
"It is impossible to make anything foolproof because fools are so 
ingenious."
--Murphy's Second Corollary
---------------------------------------------------
    http://scratchcomputing.com
---------------------------------------------------

Reply via email to