Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Windows GUI for Perl Script

by willyyam (Priest)
on Mar 16, 2005 at 16:14 UTC ( [id://439998]=perlquestion: print w/replies, xml ) Need Help??

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

I am at work, chained to a Windows machine, and I'm trying to do meaningful scripting work. Of course, I installed ActivePerl, but I would like to slap a GUI on a working script so that others who are CLI-phobic can use it. Where should I start? Thanks.

Replies are listed 'Best First'.
Re: Windows GUI for Perl Script
by Joost (Canon) on Mar 16, 2005 at 16:31 UTC
    I have no experience with win32 gui programming in perl, but there are some cross-platform toolkits I've used that work on windows too:

    Tk is good, has probably the most documentation of all the GUI toolkits for perl and it's cross-platform. It doesn't really look "window-like", though.

    wxPerl is crossplatform too, but looks and behaves much more like a native platform GUI. The docs are a bit sparse, so you'll need to translate a lot from the C++ API docs to Perl if you want to do anything special.

    Gtk and Gtk2 I haven't tried to use in years, so I'm not sure what their status is (or even if they run on windows). SDL is nice if you want moving graphics and sounds.

      Tk *does* look natively on Windows, when used wisely: http://tktable.sourceforge.net/tile/screenshots/windowsxp.html

      More to that, you can have windows look-n-feel on linux, and many different similar things.

      As for Gtk2, I was disappointed by its usage on Windows: quite old binaries, which are hard to re-build (many dependencies on different GNU libraries).
      Also, Gtk2 binaries on Windows occupy 18Mbytes on my system, and, while widgets are interesting to see, they are not native look-n-feel ...

      At least Tcl/Tk is much much more ligthweight than Gtk2, easier to setup, rebuld, develop/distribute software and use.

Re: Windows GUI for Perl Script
by perlfan (Vicar) on Mar 16, 2005 at 16:24 UTC
    Without a doubt I would go with Tk - the best part is that it comes with installed with ActiveState Perl.
Re: Windows GUI for Perl Script
by dimar (Curate) on Mar 16, 2005 at 17:26 UTC

    One approach that is rarely mentioned, but cost-effective (for some), is to simply use HTML pages as a front-end for any of your perl scripts. Every version of Windows (98 or later iirc) ships with support for HTML applications. If you already have ActiveState installed, then you can design, deploy and maintain full-fledged GUI front-ends for perl on any windows box in your shop using the same HTML that works in MSIE. There is nothing else you need to install, no need to use VB or VBscript, no need for additional OCX or OLE controls or applets.

    To determine whether this is cost-effective for you, consider: (1)time to learn; do you already know how to work with one of the GUI systems (perl/tk) (wxWindows) (MSIE HTML)?; (2)time to acquaint users; is your user base familiar with the GUI apps of any of the above environments? End users can be amazingly picky about non-functionality-centric issues when it comes to GUI, so this is one reason why some complain about the look and feel of perl/tk, or HTML, as contrasted to 'desktop' GUI apps.

    More Information

    MSDN is notorious for routinely changing the links on their site, so here are some search keywords links to MSDN search:
    Perl of Wisdom and
    perlscript and
    HTML Applications

    =oQDlNWYsBHI5JXZ2VGIulGIlJXYgQkUPxEIlhGdgY2bgMXZ5VGIlhGV
Re: Windows GUI for Perl Script
by bart (Canon) on Mar 16, 2005 at 18:46 UTC
    I can't believe nobody suggested using Win32::GUI already, and best of all: The GUI Loft.

    It's like Visual Basic but in Perl.

    Slap it on! :)

Re: Windows GUI for Perl Script
by Taulmarill (Deacon) on Mar 16, 2005 at 16:22 UTC
    you may want to use Tk or wxPerl (which is wxWidgets for Perl).
Re: Windows GUI for Perl Script
by jplindstrom (Monsignor) on Mar 16, 2005 at 19:47 UTC
Re: Windows GUI for Perl Script
by Ninthwave (Chaplain) on Mar 16, 2005 at 16:33 UTC

    I would second and thrid the fact to use Tk. I have been using Tk to slap GUIs on my perl code so that users have a recognizable interface and I have recognizable data when they are done. The nice thing is with a verly little work Tk will work the same on Linux, Unix, Max OSX and Windows. And the consitency in my opinion is much better than java. But I digress.

    use Tk;

    "No matter where you go, there you are." BB
Re: Windows GUI for Perl Script
by thekestrel (Friar) on Mar 16, 2005 at 16:33 UTC

    I was going to say QT (see TrollTech) is another option, but perlfan's post about TK being in ActiveState is a good call.


    Regards Paul.
Re: Windows GUI for Perl Script
by holli (Abbot) on Mar 16, 2005 at 16:41 UTC
    I successfully made applications that consist of a VB.NET-GUI and a compiled Perl-DLL as the backend, using PerlNET.
    A similar approach would also work for VB6 and PerlCtrl. However none of these compilers are available for free.


    holli, /regexed monk/

      Actually you can do this entirely with freely available components if you can do without the GUI designer tools in Visual studio, the VB.Net is available in the free to download .NET Framework SDK from which you can build your interface and you can create Windows Scripting Components using Perl as described in Re: Creating a COM/OLE server, Personally I would go with C# rather than VB.Net but that's a matter of taste I guess.

      /J\

      Thanks to all who replied. I am not really supposed to install anything at all, and so additional resources such as VB.NET et al are not good options, but I am reading up on Perl/Tk, and I am getting what I need. Thanks again!
Re: Windows GUI for Perl Script
by zentara (Archbishop) on Mar 17, 2005 at 13:20 UTC
    Use Tk, and tell us what you want to do. We will be happy to get you started with a script outline. (of course it may only work on linux :-) )

    I'm not really a human, but I play one on earth. flash japh

Log In?
Username:
Password:

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

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

    No recent polls found