Any GUI Toolkit Suggestions?

H

Hal Vaughan

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
 
M

Michael Carman

Hal said:
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
 
Z

zentara

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
 
H

Hal Vaughan

zentara said:
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
 
B

Ben Morrow

Quoth Michael Carman said:
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
 

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
473,764
Messages
2,569,564
Members
45,040
Latest member
papereejit

Latest Threads

Top