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

Dear Monks

I developed a Tk software for Windows I deploy as EXE (ActiveState, PerlApp)

I want now create a OSX Version of the software. I read a lot about the subject. It seems Tk (unfortunately I do not want to rewrite the enitre code, so I have to stik to Tk) needs X11 instaled on the user machine to work. Ok, I could ask user to install X11. But I've read that X11 is no more available, the only option beeing now XQuartz.

My question is, anyone have experience in creating Perl Tk GUI software and deploying them on users' computer? Any issue with XQuartz? Before I start setting up my environment (I'd need to by a Mac too), I'd like to know if this is something which can be really done.

Replies are listed 'Best First'.
Re: Tk Osx X11 XQuartz
by stefbv (Curate) on Sep 13, 2014 at 14:16 UTC

    Try Citrus Perl, Tk is included, and has a feature to create a new Perl distribution that includes all the installed modules, so you can distribute your app much easier.

Re: Tk Osx X11 XQuartz
by karlgoethebier (Abbot) on Sep 13, 2014 at 13:35 UTC

    If i where in your shoes i would forget about XQuartz and do the thing in AppleScript.

    I'm aware that some fellow monks consider this as crap and totally inferior :-( but i don't mind...

    OK, and this isn't what you wanted (a rewrite of your app) but IMHO this is the best approach.

    Your app will look good (Mac like) and it's quite easy to handle the return values of your Perl stuff in AppleScript

    Writing an comfortable installer that resolves the XQuartz dependencies would IMHO be a bigger challenge.

    Please see also:

    Regards, Karl

    «The Crux of the Biscuit is the Apostrophe»

Re: Tk Osx X11 XQuartz
by herveus (Parson) on Sep 15, 2014 at 19:59 UTC

    XQuartz *is* X11.

    I have several applications I've written in Perl using Tk that I run on my Mac without any particular problems. I keep thinking it might be good to redo them in some other GUI, but I have yet to find the motivation.

Re: Tk Osx X11 XQuartz
by Anonymous Monk on Sep 16, 2014 at 13:42 UTC
    Perhaps not the advice you want, but here's some food for thought.

    The folks at ActiveState are promoting the rather nice Tkx module that has an API not horribly unlike that of the Tk module. Most of my Tk apps were rather easy to port over to Tkx, though the 'tkhp16c' program from the book Mastering Perl/Tk would be a bit of work because it bends the UI so much...

    Disadvantage: The extra work of porting of course. Less than porting to most other systems, but still, not free.

    Advantages: Leverages the much more modern version of Tk/Tcl that you do (or will) have installed on your system.
    ActiveState, includes a stripped down version of Tk/Tcl in ActivePerl and PerlApp knows how to use it.
    And best, best of all, Apple's version of Tcl does not seem to need X11 but plays directly with Darwin.