Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Perl GUI (2013)

by Endless (Beadle)
on Aug 05, 2013 at 18:15 UTC ( [id://1047948]=perlquestion: print w/replies, xml ) Need Help??

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

I am a Perl newbie looking for Perl tools to make an acceptably modern-appearing GUI. Google searches always pop up with Perl/TK but most of the posts I see are a decade old. What is the current best for making an interactive app that doesn't seem to be a blast from the past? If Perl doesn't have any modern GUI facilities, this is a major shortcoming in the language!

Replies are listed 'Best First'.
Re: Perl GUI (2013)
by tobyink (Canon) on Aug 05, 2013 at 19:27 UTC

    Tk can feel a little clunky, but is well-documented - there's the official documentation, plus almost two decades worth of mailing list discussions, newsgroup threads, blog posts, PerlMonks nodes and so forth. There are plenty of other GUI toolkits for Perl though.

    Wx is probably the most aesthetically pleasing (in my opinion), but it can be a pain to build, especially on Windows. If you use Wx, you should also take a look at FBP::Perl.

    Prima builds is quick and reliable to install on a variety of platforms. It's certainly worth considering.

    There's also Gtk, Gtk2, Gtk3, Qt, Win32::GUI, IUP, FLTK...

    package Cow { use Moo; has name => (is => 'lazy', default => sub { 'Mooington' }) } say Cow->new->name

      The plethora of technologies in your post illustrates the core problems:

      - Native GUI is platform dependent

      - Cross-platform GUI is hard to do "right".

      - "Right"ness is an extremely subjective and contentious subject, leading to a lot of mutually-incompatbile solutions.

      There is no one "right" answer. You have to evaluate the alternatives and pick what's the best fit for your particular set of circumstances. It would be nice if the Perl community could reach consensus on the issue, but that hasn't happened and is unlikely to.

Re: Perl GUI (2013)
by Loops (Curate) on Aug 05, 2013 at 18:17 UTC
Re: Perl GUI (2013)
by mtmcc (Hermit) on Aug 05, 2013 at 18:58 UTC
    I'd vote for perl/Tk. I don't think it looks dated, particularly not on windows. It's documented quite well, and has broad functionality with a good CPAN library. It's also easily portable, with only minor adjustments sometimes needed to move from osx to linux or windows, which is becoming increasingly important these days. In any case, I think Loops has covered your options.
Re: Perl GUI (2013)
by Skeeve (Parson) on Aug 05, 2013 at 18:28 UTC

    If Perl doesn't have any modern GUI facilities, this is a major shortcoming in the language

    Who needs a GUI when we have a CLI?

    If you use a Mac, you could use Pashua for your GUI.


    s$$([},&%#}/&/]+}%&{})*;#$&&s&&$^X.($'^"%]=\&(|?*{%
    +.+=%;.#_}\&"^"-+%*).}%:##%}={~=~:.")&e&&s""`$''`"e
      I certainly agree with you--I don't need a GUI. However, my boss and our future clients would want one. As I look at it, I'm wondering about using a web interface (maybe Mojolicious? Or Dancer)
        If you go this route, know that Mojolicious is friggin' wonderful. It's a fabulous set of modules. Take a gander at Maojlicious::Lite. You can have a web framework up in about 90 seconds.
Re: Perl GUI (2013)
by Anonymous Monk on Aug 05, 2013 at 19:37 UTC
    In the past year I've become a fan of Tkx. While the Tk module builds on increasingly out of date code that was ripped from the belly of tcl, Tkx actually uses tcl under the hood, buying you easy cross platform support that pays attention to the current OS's styling, if you use the modern 'ttk' widgets. It's also as up to date as your tcl install.

    I've used it with OSX/perlbrew, Linux, Windows/Activestate & Windows/Strawberry.

    TJD

      Please allow me to vent! Tkx may be an excelent choice for person who already knows tcl. It is probably a good choice for a person's first perl graphichs module. However, for those of us who learned Tk without any knowledge or interest in tcl, the loss of Tk from ActiveState is a disaster. All existing applications are broken. There are no guidlines for converting them to Tkx. (To be fair, this could be cited as a good reason to avoid Perl/Tk for new applications.)
      Bill
Re: Perl GUI (2013)
by DrHyde (Prior) on Aug 06, 2013 at 10:59 UTC
    If Perl doesn't have any modern GUI facilities, this is a major shortcoming in the language!

    No it isn't. C doesn't have any modern GUI facilities either, but it's not a major shortcoming in the language. It's not even the biggest shortcoming in the language (that would be the obtuse syntax for specifying pointer data types IMO, followed by the propensity some C programmers have for abusing the pre-processor).

    Many (most?) programmers don't need GUIs at all, which is why most languages don't have any support for them. Instead, you use some third party library. Wx is the most common choice these days for portable code, or if you want to target a specific platform then there's Win32::GUI, Gtk for Gnome-ish platforms, and so on.

Re: Perl GUI (2013)
by Anonymous Monk on Aug 06, 2013 at 01:08 UTC
Re: Perl GUI (2013)
by dave-theunsub (Scribe) on Aug 06, 2013 at 12:07 UTC
    Shameless plug, but you may want to look into Gtk3. I wrote a bunch of examples here.
Re: Perl GUI (2013)
by dcmertens (Scribe) on Jan 18, 2014 at 15:15 UTC
    OK, this thread is a little old, but Prima certainly deserves a mention. It looks a little dated, but it is Perl-centric and cross-platform.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (7)
As of 2024-04-23 18:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found