Link to home
Start Free TrialLog in
Avatar of embalism
embalismFlag for United States of America

asked on

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

Hello,

   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.

Regards,
embalism

   
Avatar of ronan_40060
ronan_40060
Flag of United States of America image

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");
$mainwin->geometry("200x100");
MainLoop;

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

ASKER

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:
C:\>ppm
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?

Thanks,

embalism
ASKER CERTIFIED SOLUTION
Avatar of Computer101
Computer101
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial