views:

104

answers:

3

I've been around Visual Basic for years in high school, and I've grown up with the IDE supplied by Microsoft. It'd wonderful, but the educational and "working-model" editions of VB available to me through school don't allow me to redistribute software, as part of the EULA with Microsoft.

I instead find myself working in perl to design programs for friends and family, and it works fairly well, but I don't have a firm grasp on building user interfaces yet. I understand I could design user-interfaces with tcl/tk for perl, but the notion of coding all of that by hand is a bit daunting to me. That brings me to my question.

Do you have any suggestions for a tool I could use that would allow me to build GUIs for my perl programs?

Thanks in advance!

+2  A: 

I don't think you will find something as simple and well integrated for Perl as the Visual Basic GUI builder. A couple of pointers:

  • wxGlade can be used to design GUIs for the Wx GUI toolkit (for Perl, not only Python).

  • For Win32::GUI, you can use the GUI Loft to achieve something similar.

I think there's a bunch of other GUI builders including at least one for Tk, but I don't remember the name.

Either way, I believe you will have to accept that you have to do more coding vs. designing when compared to VB. The upside is that if you use Tk or Wx, your programs may well be portable to all major operating systems.

For a Perl-specific development environment, you might want to check out Padre, which is itself written in Perl using Wx. It's under active development, so eventually, somebody will probably integrate a GUI builder, too.

tsee
As mentioned by ccheneson, Glade can be used with the perl Gtk2 and Gtk2::GladeXML modules (or the Gtk2::Builder module). You can attach signals to function names in the Glade builder which will be mapped to Perl functions automatically.
MkV
james2vegas: Thanks for the comment. I'd add the Glade suggestion to my answer in an edit, but considering that ccheneson's already covers it, I'll pass. :) One a side note: I wonder what made somebody vote negatively on this post. It's on-topic and contains useful information. I guess somebody doesn't like one of the technologies I pointed at. *shrug*
tsee
+2  A: 

Frankly, having thought about GUIs for years and never getting round to them, I've found the best way to distribute GUI apps with perl is to use Catalyst, its built in server and for windows users, distributing it with Strawberry Perl (the professional edition comes with Catalyst included). For Linux or Mac users a local::lib installation to pull in the required cpan modules. Optionally bundle in a copy of portable firefox if you want not to have the usual web development pain caused by internet explorer.

tl;dr; Sidestep the whole issue by going for web development with a framework that comes with its own standalone server.

singingfish
Agreed. HTML has turned into something of a universal, platform-independent GUI these days.
Dave Sherohman
Though, if you're going that route, Catalyst might be a bit too heavyweight, perhaps look at one of the lighter web frameworks like CGI::Application or Mojo. Or look at XUL::Gui if you are ok with targetting Firefox only (but be sure to look at the XUL method for loading pre-built XUL files)
MkV
@james2vegas => be careful with the XUL() function, it doesn't actually parse the XML, it assumes it is well formed, and then translates it to Perl using regex. As stated in the docs, it is there primarily for testing examples from the Mozilla tutorials, it may not work in all cases.
Eric Strom
The heavyweight thing sounds like a premature optimisation to me. If you have to ship the kitchen sink anyway, why not use one that's going to be able to wash all the dishes, not just the small ones?
singingfish
+5  A: 

In addition to what tsee suggested, you can have a look at : Perl/Qt (using Qtdesigner) and Perl::GladeXML (using Glade)

With Glade and Qtdesigner, you can generate a XML file that will describe your user interface and it will be a matter of hooking your perl code to widget's events.

ccheneson