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


hail monks,

i was looking into different options of doing graphical interfaces with perl. i came out with Tk and Win32::GUI.
do you have any suggestions on which path to choose? i would love to do some gui stuff with perl, but i am just not sure what tools to use.

thanks monks

Replies are listed 'Best First'.
Re: GUIs with perl
by Tanalis (Curate) on Jan 20, 2003 at 21:57 UTC

    From what I've seen, and used it for, Tk is very useful for small/medium-sized apps, because in some ways it's a slightly limited module. Having said that, though, it's certainly possible to do some very complex things with it, if you're willing to think through the problem carefully.

    The other advantage of Tk is that it's platform-independant - it'll work just as well on Windows as it will on Unix, which can be a huge benefit if you need that cross-platform capability. The downside to this is that it uses the Tk widget set, which means that it looks similar, but not quite the same as, the platforms in question.

    Win32:GUI I'm not so familiar with - but from what I've read it's a similar tool to Tk, but Windows-native. It looks fairly powerful, and, as with Tk, the documentation looks very extensive.

    There're also options like wxPerl, which is a very usable Perl wrap-around to the wxWindows toolkit.

    My personal choice on a day-to-day basis is Tk - it's so far allowed me to do everything I've needed to, and I find that the cross-platform functionality is invaluable in my workplace (we use both NT and Unix boxes). It's also pretty quick and easy to knock a working GUI together, and there're some very good tutorials and books out there about the module.

    Having said that, I'm a firm believer in the right tool for the right job - so what you're actually going to use it for is much more important, in my opinion ...

    As runrig says, though, take a look at the FAQ - there's a lot more information on there.

    Just some quick thoughts ..
    -- Foxcub

Re: GUIs with perl
by runrig (Abbot) on Jan 20, 2003 at 21:33 UTC
Re: GUIs with perl
by John M. Dlugosz (Monsignor) on Jan 21, 2003 at 00:30 UTC
    I find that Tk is very nice and a good fit with Perl. On the downside, documentation is hard to find, and it doesn't do everything that a native GUI can do on Windows. It's text control, OTOH, is awesome.

    Before Tk was ready for prime time on Windows, I needed a simple GUI and used dynamic HTML. Basically, the application showed a list of things to do, and filled in results/notes on each as it did them, so it was a good fit for that kind of job. But that's what Perl is often used for -- duct tape or batch type jobs. Basically, this was a command-line program concept with a more end-user-friendly front end.

Re: GUIs with perl
by dash2 (Hermit) on Jan 21, 2003 at 00:48 UTC
    It's rather new and experimental, but I would love to hear your opinions of PerlQt. It supposedly includes RAD support via QT designer, and QT is cross platform.

    dave hj~ - closet KDE fan

      QT looks promising, but it looks like it doesn't run on Windows yet. And since the OP is even considering Win32::GUI, I'd say that is an important concern in this case.
Re: GUIs with perl
by Wysardry (Pilgrim) on Jan 21, 2003 at 00:23 UTC

    Depending on your intended usage, you might also want to consider using a browser based interface. In other words, a local web based application.

    Obviously it wouldn't be suitable for every task, but as long as you aren't too concerned with speed, it can be a very flexible solution.

    Otherwise, Tk is probably the best choice, as because it's less platform dependant there is much more documentation available on it.