Any GUI Toolkit Suggestions?

Discussion in 'Perl Misc' started by Hal Vaughan, Sep 6, 2008.

  1. Hal Vaughan

    Hal Vaughan Guest

    I've been programming in Perl for about 7 years and in Java, with Swing, for
    about 4 years, so I'm used to some GUI programming, but I have not done any
    in Perl yet. I thought there was a GUI Perl programming newsgroup, but I
    can't find it, so I'm asking here.

    I need to write a GUI program that will basically send streams of data
    through a TCP socket depending on what button is pressed in a GUI window.
    The tough parts is that the user will need to be able to add more panels,
    like a card layout in Java Swing. There'll be a drop-down or combo list
    where the user can pick which panel they want to use or to make a new one.
    Then, on each different panel, they can pick where to add buttons and
    specify the size and color of the button (or possibly pick from a list of
    icons to go on the button) and specify a text label that could go on the
    button or under it. Of course, this can get into some trouble with layout
    managers because the user would want absolute positioning and sizing of a
    button and many GUI toolkits don't always use that kind of layout.

    I've browsed through some toolkits along the way, while deciding if this
    should be written in Perl or C++ (yes, I'm going with Perl), but
    considering that the user will be specifying things like the position and
    size of a button, then have the program create a button to those specs,
    does anyone of suggestions or opininos on a GUI toolkit that would be
    particularly flexible and good for this kind of thing? I've seen some of
    what different toolkits have to say for themselves, but I'm interested in
    what people who have been using toolkits have to say.

    Thanks!


    Hal
     
    Hal Vaughan, Sep 6, 2008
    #1
    1. Advertising

  2. Hal Vaughan wrote:
    > I thought there was a GUI Perl programming newsgroup, but I can't
    > find it, so I'm asking here.


    The closest match is comp.lang.perl.tk. Strictly speaking it's a
    newsgroup for Perl/Tk, but there is a little discussion about other GUI
    toolkits there as well.

    See perldoc -q GUI for a partial list of the toolkits you can use to
    create GUIs for Perl programs.

    > considering that the user will be specifying things like the position
    > and size of a button, then have the program create a button to those
    > specs, does anyone of suggestions or opininos on a GUI toolkit that
    > would be particularly flexible and good for this kind of thing?


    Tk has three different geometry managers. pack is the one used most
    often, grid works better for tabular layouts, and place allows absolute
    positioning. You can mix managers within a program (just don't mix them
    within a frame!) which would allow you to use pack or grid for your
    application while allowing users to get absolute positioning (withing
    their sandbox) via place.

    > I've seen some of what different toolkits have to say for themselves,
    > but I'm interested in what people who have been using toolkits have
    > to say.


    I've used Perl/Tk for a long time. I've recently transitioned to Tkx but
    can't recommend it as a starting point for newcomers.

    Perl/Tk is a deep binding to Tcl/Tk. It's mature, well-documented, and
    has a rich library of megawidgets. It's also stagnant and in danger of
    becoming obsolete. My major complaint is that you can't get a
    platform-native look with it. It's probably the most popular of the Perl
    GUI options. Because of this and the excellent documentation it should
    be relatively easy to get started with.

    Tkx is a very thin layer over Tcl/Tk. It's shiny and new, supports all
    the newer goodies in Tcl/Tk like tiled (themed) widgets but has scant
    documentation and no widget libraries. It's not bad to use if you're
    coming from Perl/Tk and it should be pretty easy if you're familiar with
    Tcl/Tk. If not, it's probably best to stay away for now. It defers to
    the Tcl documentation for most things which means that you're left with
    reading Tcl and trying to figure out how to convert it to Perl.

    -mjc
     
    Michael Carman, Sep 6, 2008
    #2
    1. Advertising

  3. Hal Vaughan

    zentara Guest

    On Sat, 06 Sep 2008 16:25:12 GMT, Hal Vaughan <> wrote:


    >The tough parts is that the user will need to be able to add more panels,
    >like a card layout in Java Swing. There'll be a drop-down or combo list
    >where the user can pick which panel they want to use or to make a new one.
    >Then, on each different panel, they can pick where to add buttons and
    >specify the size and color of the button (or possibly pick from a list of
    >Thanks!


    It sounds like the perfect job for the Notebook widget. Both Tk and Gtk2
    have them. Tk is easier to learn, while Gtk2 is a bit more advanced and
    difficult to master.


    zentara

    --
    I'm not really a human, but I play one on earth.
    http://zentara.net/Remember_How_Lucky_You_Are.html
     
    zentara, Sep 7, 2008
    #3
  4. Hal Vaughan

    Hal Vaughan Guest

    zentara wrote:

    > On Sat, 06 Sep 2008 16:25:12 GMT, Hal Vaughan <> wrote:
    >
    >
    >>The tough parts is that the user will need to be able to add more panels,
    >>like a card layout in Java Swing.  There'll be a drop-down or combo list
    >>where the user can pick which panel they want to use or to make a new one.
    >>Then, on each different panel, they can pick where to add buttons and
    >>specify the size and color of the button (or possibly pick from a list of
    >>Thanks!

    >
    > It sounds like the perfect job for the Notebook widget. Both Tk and Gtk2
    > have them.  Tk is easier to learn, while Gtk2 is a bit more advanced and
    > difficult to master.


    I guess there's no reason to go with Gtk2 if TK will do what I need.  The
    notebook widget is basically what I'd be using.  There are other
    variations, but it'd be just fine.

    It occurs to me that I should do the GUI designer part of this app as a
    single module, if I could, since I'm sure other people could use an app
    that lets the user define buttons then attach functions to those buttons.

    Thanks, all, for the help.  I went scrounging and got lucky and found a
    cheap copy of "Mastering Perl/Tk" so I bought it.  I haven't checked how up
    to date it was, but it was gently used and dirt cheap so I figured I might
    as well get it.


    Hal
     
    Hal Vaughan, Sep 8, 2008
    #4
  5. Hal Vaughan

    Ben Morrow Guest

    Quoth Michael Carman <>:
    > Hal Vaughan wrote:
    > > I thought there was a GUI Perl programming newsgroup, but I can't
    > > find it, so I'm asking here.

    >
    > The closest match is comp.lang.perl.tk. Strictly speaking it's a
    > newsgroup for Perl/Tk, but there is a little discussion about other GUI
    > toolkits there as well.
    >
    > See perldoc -q GUI for a partial list of the toolkits you can use to
    > create GUIs for Perl programs.


    Note that this particular answer was rewritten in the 5.10 version of
    the FAQ. With 5.8 you can use perldoc -q tk, but the answer is not
    terribly useful.

    Ben

    --
    "Faith has you at a disadvantage, Buffy."
    "'Cause I'm not crazy, or 'cause I don't kill people?"
    "Both, actually."
    []
     
    Ben Morrow, Sep 9, 2008
    #5
    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. asdf
    Replies:
    0
    Views:
    576
  2. Alessandro Pinto

    Standard GUI Toolkit

    Alessandro Pinto, Feb 7, 2004, in forum: C++
    Replies:
    13
    Views:
    765
    Dylan Nicholson
    Feb 12, 2004
  3. Junpei
    Replies:
    2
    Views:
    451
  4. vasudevram
    Replies:
    2
    Views:
    354
    vasudevram
    Jun 9, 2006
  5. Daniel Folkes
    Replies:
    2
    Views:
    1,060
    Mike Driscoll
    Feb 5, 2008
Loading...

Share This Page