# from Mattia Barbon
# on Sunday 08 March 2009 03:28:

>   AFAIK it is an unsolvable problem: on OS X either you use a bundle
>(and the wxPerl executable internally uses one) or you don't get
> focus. There is no way around that.

  s/or you don't get focus/or you don't get input events/

But you can use a bundle and not wxPerl.  There's also a subtle 
difference in that if you create your own bundle and launch with 
`open`, your app comes to the front (instead of the back) and gets the 
keyboard focus without needing to click on the window.  The `open` 
utility replicates clicking on the .app -- or clicking on an associated 
file.  But, the file is not in argv, so won't be in your @ARGV.  The 
working directory will also (apparently) always be '/'.

I have an experiment (which was used in packaging dotReader) based on 
the camelbones code, but intended to play nice with cross-platform 
projects.  This embeds a perl interpreter in a small C application to 
deal with the issues, but I've since learned that the xcode approach is 
complete overkill.  Still not sure about AEGetParamDesc() -- possibly 
that could fit into some small XS module or is already implemented in 
Perl via wxWidgets.

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

If anyone is interested in getting this cleaned-up and onto the CPAN, I 
would be more than happy to see it happen.

--Eric
-- 
But you can never get 3n from n, ever, and if you think you can, please
email me the stock ticker of your company so I can short it.
--Joel Spolsky
---------------------------------------------------
    http://scratchcomputing.com
---------------------------------------------------

Reply via email to