| Register | FAQ | Calendar | Search | Today's Posts | Mark Forums Read |
|
#1
| |||
| |||
| 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 |
|
#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 |
|
#3
| |||
| |||
| Hal Vaughan wrote: > 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. I want to recommend you Perl/Tk. If you want to see an example then you can download my freeware GRPING from my site http://www.practisoft.cz?download+en You can download Windows or Linux version. The second one (GRPING_1_2.TAR.GZ) is a source code and you can study a Tk by examples ;-) -- Petr Vileta, Czech republic (My server rejects all messages from Yahoo and Hotmail. Send me your mail from another non-spammer site please.) Please reply to <petr AT practisoft DOT cz> -- Posted on news://freenews.netfront.net - Complaints to news@netfront.net -- |
|
#4
| |||
| |||
| On Sat, 06 Sep 2008 16:25:12 GMT, Hal Vaughan <hal@halblog.com> 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 |
|
#5
| |||
| |||
| zentara wrote: > On Sat, 06 Sep 2008 16:25:12 GMT, Hal Vaughan <hal@halblog.com> 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 |
|
#6
| |||
| |||
| On Mon, 08 Sep 2008 05:41:50 GMT, Hal Vaughan <hal@halblog.com> wrote: >zentara wrote: > >> 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 You also can search groups.google.com for "perl tk notebook" for many examples. There is also the Tk: ynaTabFramehttp://search.cpan.org/search?query=...frame&mode=all which is a Notebook with many added features. zentara -- I'm not really a human, but I play one on earth. http://zentara.net/Remember_How_Lucky_You_Are.html |
|
#7
| |||
| |||
| Quoth Michael Carman <mjcarman@mchsi.com>: > 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.me.uk] |
![]() |
| Thread Tools | |
| Display Modes | |
In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.