Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win


What is best way to design a GUI for a perl based project? WYSIWYG?

Posted on 2004-08-06
Medium Priority
Last Modified: 2008-02-26

   I have been writing command line scripts for quite some time now using activestate's komodo development environment. However, one of the major shortcomings of Komodo is the inability to create Window's style graphical user interfaces. Recently activestate published what is now called Komodo 2.x professional and included an exciting new feature called GUI BUILDER. The intent of GUI BUILDER was to provide the Perl programmer with WYSIWYG style GUI development environment and to tighly link this to the code environment of Komodo. This is quite similar to Visual Basic for those of you not familiar with komodo. I played around with GUI Builder and found it lacking in MANY ways. No support, very buggy, code space NOT tightly integrated, very simple subroutine calls would not process, inability to adjust the autogenerated code in any meaningful way, etc. Although it did look "pretty." Maybe in a few years they will have a good product.

   Thus began a long investigation into options for PERL programmers concerning GUI development. Ideally, someone would create a program exactly like Visual Basic (Microsoft Visual Studio) but have it called Visual Perl. Low and Behold activestate has this already done, it is called Visual Perl. Has anyone tried using this program? I am not quite sure what the "Visual" part of it is coming from the standpoint of Visual Studio's design methodology: there is no form window for controls to be dragged and dropped; there is only a code window. What good is this? I guess they assume that you will design your GUI with another language like VB and then use system process calls from the VB code space to the PERL scripts that you write? This idea of program design doesn't seem right. I really don't have experience in this manner so any REAL examples someone could give me supporting the use of a WYSIWYG GUI builder with perl would be excellent.

How would I go about using VB to design a user interface, but use Perl for the "guts" of the programming?

   But how about a pure WYSIWYG form builder written and designed for Perl? I have tried the following: Guido, The GUI Loft, and GUI Builder from activestate. Perhaps there are more but these were the most prominent. There are also things that use Tk: Perl/Tk, TclTk, etc. However, Perl has definitely been short ended concerning Tk, while Tcl gets all the good support.

Anyway, I hope the above discussion sheds light on where my knowledge level is. I am really interested in being able to combine different programming environments (to the best of all worlds, as they say) but am not quite sure how it is done. Besides using the OS (saving state information in files, system process call, etc.) I do not see how two different programming environments can interoperate. If interoperability is the best solution to my programming needs, ideally I would want to do the following:

1. use VB to create my "front end" GUI
2. use Perl for all programming
3. use SQL for database work.

In the middle is Perl controlling the front and back.

However, I want to use pure PERL solutions. So in a world of just PERL, here is my primary question:

What is best way to design a GUI for a perl based project? (please reference a real example and not some vaguery like "oh, just use Tk and Perl," because that doesn't help at all!!!)

Thank you very much for your help, I look forward to any reply.


Question by:embalism
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Expert Comment

ID: 11747899
Hi there embalism

Well I have not really used Perl/TK
But I have a very good book which is creating GUI applications using Perl/TK by SkillSoft
and I have a summarized information from that book for you .

The Tk module is one of many Perl modules that enable you to add more functionality to the Perl programs. Perl/Tk provides you with the components to develop a simple or sophisticated GUI application.

The very basic code which creats a MainWindow using Perl/TK
Code in mainwindow.pl file
use Tk;
use warnings;
use strict;
$mainwin = new MainWindow();
$mainwin->title("Main Window");

The above code code wud give you a fairly good idea
let me know if you need more samples
Good luck

Author Comment

ID: 11748558
Hi Ronan,

   Thanks for the reply.

   I have been looking into Perl/Tk for the last few days. It seems like a very robust, well developed GUI builder for Perl. Although I do understand the code, and how to hand-write the GUI applications, I am sorely dissatisfied with having to hand-write my GUI. What I really want to get my hands on is a GUI developer with a WYSIWYG style interface using Perl/Tk. Ideally I would be able to drag and drop widgets onto a form and the interface program would auto-generate the GUI form code for me. The auto-generated code must be in perl.

1. the GUI Loft does not generate any code that the programmer can use. This makes the program useless in my eyes. It also does not have a menu widget.
2. Guido has the following installation error:

     Installation of XML::DOM failed.
Can't locate object method "new" via package "XML::DOM::Parser" (perhaps you for
got to load "XML::DOM::Parser"?) at guido_installer_0_25.pl line 177.
Parsing OSD file at http://guido.sf.net/downloads/guido.osd...

   So I try and install this mysterious XML::DOM::Parser:
PPM - Programmer's Package Manager version 3.1.
Copyright (c) 2001 ActiveState Corp. All Rights Reserved.
ActiveState is a devision of Sophos.

Entering interactive shell. Using Term::ReadLine::Stub as readline library.

Type 'help' to get started.

ppm> install xml::dom::parser
Searching for 'xml::dom::parser' returned no results. Try a broader search first

Which means that the installer is missing a critical path. If I can't get it to work on Windows XP, who is this program for? Maybe not my OS?

3. wxwindows has been suggested, but I can't figure out how to keep a smooth running development enviroment. Plus it's not in Perl!
4. Prima is written in VB and would be very nice if I could get it to run. I have been posting for a while now and haven't got any advice that has made it work. I get many compiliation errors.

5. That leaves activestate's GUI Builder. At first glance it seems like the perfect choice. However, besides a VERY basic manual, there isn't any support. For instance, how do I add more widgets to the toolbox? Why does the autogenerated code not include widget mouse click options (ie button_1_click()) - expect for on the very initial save of the design? (This isn't actually so bad - I can still handwrite the function). Also there is the cost!!!! It is $295 dollars, and if you want to produce stand-alone applications you have to pay some other $$$.

I  can go on and on about this.

Anyone know of a Perl/Tk GUI developer with documentation and mailing lists? One that is robust and practical to develop large projects with?



Accepted Solution

Computer101 earned 0 total points
ID: 11989669
PAQed, with points refunded (500)

E-E Admin

Featured Post

Enroll in October's Free Course of the Month

Do you work with and analyze data? Enroll in October's Course of the Month for 7+ hours of SQL training, allowing you to quickly and efficiently store or retrieve data. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Many time we need to work with multiple files all together. If its windows system then we can use some GUI based editor to accomplish our task. But what if you are on putty or have only CLI(Command Line Interface) as an option to  edit your files. I…
I have been pestered over the years to produce and distribute regular data extracts, and often the request have explicitly requested the data be emailed as an Excel attachement; specifically Excel, as it appears: CSV files confuse (no Red or Green h…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Six Sigma Control Plans

604 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question