Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

wxPerl and MacOS

by sciurius (Sexton)
on Sep 23, 2020 at 08:38 UTC ( [id://11122113]=perlquestion: print w/replies, xml ) Need Help??

sciurius has asked for the wisdom of the Perl Monks concerning the following question:

Greetings,

I have a neat perl application that uses Wx (wxPerl). It runs on Linux, Windows and MacOS.

One of the things currently missing on MacOS is the ability to respond to Finder commands. For example, double-clicking on an associated document should start the application. The association is dealt with in the app's Info.plist and works -- double-clicking the document starts the application but the application always starts with its main window, as if the application was double-clicked instead of the document.

The wxWidgets docs suggest that I should override Wx::App::MacOpenFiles but this function does not seem to be in wxPerl.

Are there any PerlMonks using wxPerl on MacOS that could shed some light on this?

Replies are listed 'Best First'.
Re: wxPerl and MacOS
by Anonymous Monk on Sep 23, 2020 at 10:20 UTC

    The wxWidgets docs suggest that I should override Wx::App::MacOpenFiles but this function does not seem to be in wxPerl.

    why do you say that? Add this to your program

    sub Wx::App::MacOpenFiles { die "@_" }

      Sure, I can *write* the function, but it will not get called by the Wx framework...

        If the wxPerl XS bindings do not have that callback, then you will need to write a patch adding that binding. It should not be too hard — XS can also supply an empty default Wx::App::MacOpenFiles sub for the user to override, or accept a coderef to call when WxWidgets invokes the callback.

        So you tried it? Go ahead and try it.
      Yes, welcome to the world of monkey patching. Or as I now like to call it, monkey punching.

      For OP, what Anonymous Monk is suggesting is that you define the fully qualified method in your own code. Will this work? I have no idea. But it is a pointer in the right direction for where to stick the method you're claiming you can easily write.

        Will this work? I have no idea.

        amazingly helpful

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://11122113]
Approved by hippo
Front-paged by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (3)
As of 2024-04-19 16:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found