gui in perl

E

Edo

Hello

I need to know if perl is ok for an interactive gui programming,

e.g. tasks I need to do are:
use a form on the desktop to run a perl script by mouse click, let perl
script variables use values from text boxes, create a chart with mouse
location indicated when moved on the x and y axis. add scroll function
to a chart, automate chart scale, display data from files on a spread
sheet ...etc.

or should I look into java as well and if so, would both languages work
in connection with each other?
any light is appriciated

thanks
 
J

James Willmore

I need to know if perl is ok for an interactive gui programming,
<snip>

I've used Tk scripts without issue and find they are easier to deal
with than Java GUI's - but my opinion is biased :)

There are many Tk module that you can incorporate into your script
that will speed development.

HTH

--
Jim

Copyright notice: all code written by the author in this post is
released under the GPL. http://www.gnu.org/licenses/gpl.txt
for more information.

a fortune quote ...
Fortune's Real-Life Courtroom Quote #52: Q: What is your name?
A: Ernestine McDowell. Q: And what is your marital status? A:
Fair.
 
B

Ben Morrow

Edo said:
I need to know if perl is ok for an interactive gui programming,

I have used Tk very successfully for this.
or should I look into java as well and if so, would both languages work
in connection with each other?

You may want to look at JPL (see the jpl/ dir in the Perl source
distro) or Inline::Java.

Ben
 
B

Ben Morrow

As others have said, there is also the Tk stuff - certainly pretty easy to
use and get up and running, but from my experience it produces horrible
looking apps - but that may not be of concern to you, and I know the Tk
guys are working on it.

While this is certainly true under Unix, the win32 port of Tk produces
apps which look just like any other windows app; no more and no less
offensive :).

Ben
 
R

Rich

Edo said:
Hello

I need to know if perl is ok for an interactive gui programming,

e.g. tasks I need to do are:
use a form on the desktop to run a perl script by mouse click, let perl
script variables use values from text boxes, create a chart with mouse
location indicated when moved on the x and y axis. add scroll function
to a chart, automate chart scale, display data from files on a spread
sheet ...etc.

or should I look into java as well and if so, would both languages work
in connection with each other?
any light is appriciated

thanks

If portability and licensing isnt a major concern, and you're on a unix
machine, I would look at PerlQt. Depending on your abilities in both
languages, you should get apps up and running quicker in PQt than Java
where the compile times can sometimes start to really eat into development
time (but hey - if you've got a few Opterons lying about that wont really
matter!). If you need to build large scale gui apps with other developers
coming on board, it would make more sense to go with Java, but I hope that
might change with the advent of p6!

You might also consider the GTk or wxWindow bindings, but the real advantage
of PerlQt is QtDesigner, the GUI form builder supplied with Qt. It makes
development much easier, and is IMHO superior to the fairly basic tools you
can get for GTk or wxWindows.

As others have said, there is also the Tk stuff - certainly pretty easy to
use and get up and running, but from my experience it produces horrible
looking apps - but that may not be of concern to you, and I know the Tk
guys are working on it.

In your case it would also be important to see if charting modules are
available, so that may limit your choice further.

In summary: PerlQt, GTk, wxWindows, Tk in no particular order.

Whatever you choose, have fun!
 
M

Matt Garrish

Ben Morrow said:
While this is certainly true under Unix, the win32 port of Tk produces
apps which look just like any other windows app; no more and no less
offensive :).

But is it worth the pain? I've given up on Tk and just use vc++ to build gui
wrappers to my perl scripts (when I'm too lazy to rewrite all my code in
vc++ but have to make a program "user-friendly").

Matt
 
H

Helgi Briem

While this is certainly true under Unix, the win32 port of Tk produces
apps which look just like any other windows app; no more and no less
offensive :).

It looks just as good (or bad) as the underlying windowing
system, X, Apple Mac or whatever. It certainly always
looks better than anything produced by Java and it's far,
far easier to program. My god, Java produces horrible looking
guis.
 
H

Helgi Briem

But is it worth the pain? I've given up on Tk and just use vc++ to build gui
wrappers to my perl scripts (when I'm too lazy to rewrite all my code in
vc++ but have to make a program "user-friendly").

You find VC++ easier than Tk?!?!

You've been doing something wrong, that's for sure.
 
B

Ben Morrow

Helgi Briem said:
It looks just as good (or bad) as the underlying windowing
system, X, Apple Mac or whatever.

X, unlike win32 and MacOS, does not define a widget set. Tk uses its
own, which is different from any other, and (IMHO) is truly hideous.
It certainly always looks better than anything produced by Java and
it's far, far easier to program. My god, Java produces horrible
looking guis.

Yes. :) I'm hoping the GCJ folks are going to implement Swing in terms
of Gtk...

Ben
 
M

Malte Ubl

Helgi said:
It looks just as good (or bad) as the underlying windowing
system, X, Apple Mac or whatever. It certainly always
looks better than anything produced by Java and it's far,
far easier to program. My god, Java produces horrible looking
guis.


Thats Swing, not Java. AWD (right acronym?) used by e.g. Eclipse is
really beautiful.

malte
 
L

laszlo

Edo said:
Hello

I need to know if perl is ok for an interactive gui programming,

e.g. tasks I need to do are:

If you wanna write satand alone programs use Java, or pert with Tk
module. The advantege of the perl is the significantly less owerhead,
and the superior string processing capability, the advantege of the
Java is the more superior user interface capability

If you wanna write CGI scripts w/ interactive webpages, you may use
perl w/ some limitations w/o special modules

- use a form on the desktop to run a perl script by mouse click, let
perl
script variables use values from text boxes

This is what CGI-perl does primarily.

- create a chart with mouse location indicated when moved on the x and
y axis.

I would use javascript to save and show the mouseclicks, then (after
finishing ) perl script to show the lines from the vector posted by
the javascript

- add scroll function to a chart,

with the browsers this is automatic

- automate chart scale,

you can write lines (w/ any calculated scaling) simply generating
null images with STYLE parameters which set the sizes and the
background color. Bars or axias paralel lines are one image, not
axis paralell lines could be generated dotwise, by my experience 5000
images per webpage are still work with acceptable speed

- display data from files on a spread sheet

For active spread sheet (on webpage) you may use javascript w/ quite
easily, perl could set up a set of text input gadgets
 
A

Ala Qumsieh

Ben Morrow said:
X, unlike win32 and MacOS, does not define a widget set. Tk uses its
own, which is different from any other, and (IMHO) is truly hideous.

No. Tk uses the Motif look on X by default, which I agree is horrible. But,
this can be very easily changed, although not too many people know about it.
Check out this thread on comp.lang.perl.tk for more details (let's hope my
newsreader doesn't screw it up):

http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&c2coff=1&frame=r
ight&th=7123d87e82847225&seekm=TSpwb.483254%246C4.125757%40pd7tw1no#link9

I have personally used Qt, Tk and Java, and while all offer pretty much the
same functionality, I like Tk the most. It certainly has the most mature
Perl port.

--Ala
 
J

James Willmore

James Willmore said:
<snip>

I've used Tk scripts without issue and find they are easier to deal
with than Java GUI's - but my opinion is biased :)

There are many Tk module that you can incorporate into your script
that will speed development.

Just to qualify my comments ...
I meant perl/Tk :)

Jim
(jwillmore _at_ adelphia _dot_ net)
 
B

Ben Morrow

Ala Qumsieh said:
No. Tk uses the Motif look on X by default, which I agree is horrible. But,
this can be very easily changed, although not too many people know about it.
Check out this thread on comp.lang.perl.tk for more details (let's hope my
newsreader doesn't screw it up):

http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&c2coff=1&frame=r
ight&th=7123d87e82847225&seekm=TSpwb.483254%246C4.125757%40pd7tw1no#link9

Thank you... I'll take a look. I agree that the API is nicer than the
alternatives.

Ben
 
M

Matt Garrish

Helgi Briem said:
You find VC++ easier than Tk?!?!

You've been doing something wrong, that's for sure.

It's not about complexity, but the speed at which you can toss a gui
together. Much as I enjoy sitting for hours positioning buttons and playing
with colours and alignment just to get a half-fugly Tk gui, I'll stick to
the simplicity of creating one in VC++. As noted above, I avoid trying to
code in the half-baked language as much as possible (it's not quite C and
not quite C++, but damn if doesn't make a nice mess of both), but passing a
few user-variables on to a perl script doesn't require much of a brain, to
which I can well attest... : )

Matt
 
S

Stuart Moore

Having used wxWindows/perl for a not too complicated GUI, we found it so
slow and memory hogging that we ended up scrapping it, learning C++ from
scratch, doing the GUI in wxWindows (using sockets to communicate with
perl scripts where we needed to) and were very happy with our decision.

Maybe the other bindings were better, but our conclusion was Perl just
wasn't up to the task of getting something sensibly sized and not
requiring a state of the art machine to be responsive.

Stuart
 
M

Matt Garrish

Bart Lateur said:
Take a look at The GUI Loft, not for Tk, but for Win32::GUI on Win32. As
easy as VB, which means, a lot easier than VC++ (IMO)

<http://www.bahnhof.se/~johanl/perl/Loft/>

Very interesting! (And Win32::GUI definitely creates a much nicer interface
than you wind up with in Tk.) If it makes gui building as simple as it
looks, I'm definitely coming back to Perl for my user interfaces.

Matt
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top