gui in perl

Discussion in 'Perl Misc' started by Edo, Dec 4, 2003.

  1. Edo

    Edo Guest

    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
    Edo, Dec 4, 2003
    #1
    1. Advertising

  2. On Fri, 05 Dec 2003 08:48:39 +1100
    Edo <> wrote:

    > 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.
    James Willmore, Dec 5, 2003
    #2
    1. Advertising

  3. Edo

    Ben Morrow Guest

    Edo <> wrote:
    > 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

    --
    Musica Dei donum optimi, trahit homines, trahit deos. |
    Musica truces mollit animos, tristesque mentes erigit. |
    Musica vel ipsas arbores et horridas movet feras. |
    Ben Morrow, Dec 5, 2003
    #3
  4. Edo

    Ben Morrow Guest

    wrote:
    > 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

    --
    Heracles: Vulture! Here's a titbit for you / A few dried molecules of the gall
    From the liver of a friend of yours. / Excuse the arrow but I have no spoon.
    (Ted Hughes, [ Heracles shoots Vulture with arrow. Vulture bursts into ]
    /Alcestis/) [ flame, and falls out of sight. ]
    Ben Morrow, Dec 5, 2003
    #4
  5. Edo

    Rich Guest

    Edo wrote:

    > 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!
    --
    Rich
    Rich, Dec 5, 2003
    #5
  6. Edo

    Matt Garrish Guest

    "Ben Morrow" <> wrote in message
    news:bqq0nn$58a$...
    >
    > wrote:
    > > 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 :).
    >


    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
    Matt Garrish, Dec 5, 2003
    #6
  7. Edo

    Helgi Briem Guest

    On Fri, 5 Dec 2003 13:20:55 +0000 (UTC), Ben Morrow
    <> wrote:

    > wrote:
    >> 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 :).


    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.
    Helgi Briem, Dec 5, 2003
    #7
  8. Edo

    Helgi Briem Guest

    On Fri, 5 Dec 2003 08:40:02 -0500, "Matt Garrish"
    <> wrote:

    >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.
    Helgi Briem, Dec 5, 2003
    #8
  9. Edo

    Ben Morrow Guest

    Helgi Briem <> wrote:
    > On Fri, 5 Dec 2003 13:20:55 +0000 (UTC), Ben Morrow
    > <> wrote:
    >
    > > wrote:
    > >> 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 :).

    >
    > 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

    --
    "The Earth is degenerating these days. Bribery and corruption abound.
    Children no longer mind their parents, every man wants to write a book,
    and it is evident that the end of the world is fast approaching."
    -Assyrian stone tablet, c.2800 BC
    Ben Morrow, Dec 5, 2003
    #9
  10. Edo

    Malte Ubl Guest

    Helgi Briem wrote:
    >>>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 :).

    >
    >
    > 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
    Malte Ubl, Dec 5, 2003
    #10
  11. On Fri, 05 Dec 2003 08:48:39 +1100, Edo <>
    wrote:

    >Hello
    >
    >I need to know if perl is ok for an interactive gui programming,
    >
    >e.g. tasks I need to do are:

    [snip]

    use Tk;


    Michele
    --
    # This prints: Just another Perl hacker,
    seek DATA,15,0 and print q... <DATA>;
    __END__
    Michele Dondi, Dec 5, 2003
    #11
  12. Edo

    laszlo Guest

    Edo <> wrote in message news:<>...
    > 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
    laszlo, Dec 5, 2003
    #12
  13. Edo

    Ala Qumsieh Guest

    "Ben Morrow" <> wrote in message
    news:bqq6tc$a3k$...
    >
    > Helgi Briem <> wrote:
    > > On Fri, 5 Dec 2003 13:20:55 +0000 (UTC), Ben Morrow
    > > <> wrote:
    > >
    > > > wrote:
    > > >> 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 :).

    > >
    > > 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.


    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

    --
    $email =~ s/xx// if $replying_by_mail;
    Ala Qumsieh, Dec 5, 2003
    #13
  14. James Willmore <> wrote in message news:<>...
    > On Fri, 05 Dec 2003 08:48:39 +1100
    > Edo <> wrote:
    >
    > > 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.


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

    Jim
    (jwillmore _at_ adelphia _dot_ net)
    James Willmore, Dec 5, 2003
    #14
  15. Edo

    Ben Morrow Guest

    "Ala Qumsieh" <> wrote:
    > 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

    --
    "If a book is worth reading when you are six, *
    it is worth reading when you are sixty." - C.S.Lewis
    Ben Morrow, Dec 5, 2003
    #15
  16. Edo

    Matt Garrish Guest

    "Helgi Briem" <> wrote in message
    news:...
    > On Fri, 5 Dec 2003 08:40:02 -0500, "Matt Garrish"
    > <> wrote:
    >
    > >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.
    >


    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
    Matt Garrish, Dec 6, 2003
    #16
  17. Edo

    Bart Lateur Guest

    Matt Garrish wrote:

    >It's not about complexity, but the speed at which you can toss a gui
    >together.


    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/>

    --
    Bart.
    Bart Lateur, Dec 6, 2003
    #17
  18. Edo

    Stuart Moore Guest

    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
    Stuart Moore, Dec 6, 2003
    #18
  19. Edo

    Matt Garrish Guest

    "Bart Lateur" <> wrote in message
    news:p...
    > Matt Garrish wrote:
    >
    > >It's not about complexity, but the speed at which you can toss a gui
    > >together.

    >
    > 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
    Matt Garrish, Dec 6, 2003
    #19
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. paul.foreman

    GUI - GUI value passing

    paul.foreman, Oct 22, 2004, in forum: Java
    Replies:
    5
    Views:
    751
    Michael Rauscher
    Oct 25, 2004
  2. ulysses
    Replies:
    4
    Views:
    764
    Werner Schiendl
    Oct 22, 2003
  3. Andrew Lapidas

    PyGTK GUI update without signals from GUI

    Andrew Lapidas, Apr 13, 2008, in forum: Python
    Replies:
    0
    Views:
    415
    Andrew Lapidas
    Apr 13, 2008
  4. Stefan Ram
    Replies:
    3
    Views:
    492
    Arne Vajhøj
    Nov 20, 2011
  5. ngoc
    Replies:
    7
    Views:
    171
    zentara
    Jul 14, 2005
Loading...

Share This Page