Perl is one of the most popular languages out there, and is used for everything from mission-critical projects to Web applications to “glue.” It is not, however, often used for GUI programming and prototyping. The author thinks it should be, and you probably will too — after this look at some of the more complex widgets available for Perl/Tk.
Using advanced widgets in Perl/Tk
2004-08-11 General Development 10 Comments
1996 called, they want their code back.
Sorry, but this is NOT a good-looking (visually or code-wise) language-toolkit example.
Better sets are maybe Qt#, GTK#, PyObjC, wxPython, wx(any other binding), and so on.
By default, Tk uses the Motif look and feel on *nix platforms. I agree this is ugly. But on Windows and Mac OS, Tk uses the native look of the underlying platform.
In any case, the default look can be easily changed. I find it much cleaner to set -borderwidth to 1 (default is 2) for all widgets, and change the default background color. Other than that, Tk is just as good as any other GUI toolkit out there.
Perl supports Qt and Gtk bindings, you are better served by these if you want people to actually use your program.
Frankly, I like all of them for different reasons. I like Tk because there are a lot of books around that describe how to use it in a scripting environment, and that’s a lot of fun to do if you don’t have time to go around and around the compilation cycle.
Now, if there were some good books on how to use scripting with these other toolkits, I think I’d feel differently.
Perl/Gtk and Perl/Qt bindings operate in the same way as Tk bindings.
What is the compilation step you are referring to?
This is a great combo. I use it for admin work on Windows.
I have not personally used perl/tk but my friend uses it for a POS like application which uses atleast 60 MB memory at any given time on windows xp.
He uses ActiveState Perl.
This high memory usage is a problem.
A lot of people may not like Perl/Tk, and I’ll be the first to say that it is a bit old and crusty. At least the Tk side of the equation. On CE, there are a lot of options for programming on the device itself, which is one of the reasons I really like the platform. If Palm OS or Linux/Qtopia had as many options for on-board GUI app development, I’d have no problem switching though- I’ve no love for CE itself.
But… Perl/Tk makes for a nice little dev environment for CE. And the code I write on my PDA can be run on my desktop, often with no changes to anything but file paths.
I’ve never had a problem with it taking up 60 MB of RAM though. I’ve developed and ran Perl/Tk apps on WinCE and PocketPC devices with as little as 16 MB of RAM and as much as 64.
You can not make such a conclusion based on one Perl/Tk app. In fact, the statement is wrong. I have written various apps that don’t take that much memory on winXP. The most likely cause of the high memory problem is your friend’s non-Tk code.
I should say from the start that I’m not aspousing any computer usage approach over any other. However, being who I am and having the physical circumstances that I have, I very much enjoy the back-and-forth experience of working from a prompt.
When I refer to the compilation cycle, I’m talking about the need to perform compile steps to produce a working demo of the toolkit. At minimum, I’m talking about having to write a script, and then run it from the command line or by clicking on it in a window. For enjoyment, I prefer something more like the old “immediate mode” in Basic. Like an interactive command shell.
Tcl/Tk has the “wish” application for conversationally building a GUI. Perl has ptksh. Python has IDLE/Tkinter.
What are the equivalent methods for playing around with the Qt and GTK user-interfaces conversationally?