| Module Info
| Add a review of Tk
I can't install this module. :(
the error is:
make: *** No rule to make target `all', needed by `libpng.a'. Stop.
This is a very strong piece of work, thanks!
As an old-time perl/Tk user, I'm really happy to see it is actively maintained, even for the more obtrusive OS's like Irix, AIX, and HP-UX.
Much easier to learn and use than e.g. Wx, and almost everything can be done. A lot of extra modules available on CPAN, from which you can learn how to do more difficult stuff.
For me ease-of-use and ease-of-maintainability is much more important that a missing `native' look, what Wx pretends to offer. So far I have been able to build simple, fast and functional GUI's with perl/Tk.
I am surprised at the adverse comments on Perl/Tk/
Starting with a pretty decent command of C and C++, I found it vastly easier to learn perl and perl/Tk from scratch than to write programs interfacing with the C to Tk toolbox.
Good module and it is easy to create robuste GUI. It is also possible to compile an application wroten in Perl Tk.
When we will have an update of Tk module ?
Perl Tk is certainly outdated. However, with good documentation via books like Mastering Perl it is relatively easy to create a simple multi-platform application. Porting to Mac, Linux, and Windows is also trivial via tools like ActiveState's PDK toolkit PerlApp program. However, without a lot of trial and error, it is difficult to get anything like an attractive looking program.
The Tk core appears to be no longer under development although users do contribute modules from time to time.
I am now switching to ActiveState's Tkx, which allows all recent Tck/Tk widgets to be used, and also seems to be just cleaner although the syntax is sometimes unintuitive. Converting a Tk app to Tkx is not very difficult either. Wx also seems to be gaining popularity as an alternative to Tk although there the perl specific documentation seems lacking.
Perl TK is a vast collection of C/XS/Perl that allows the Perl platform to produce a TK GUI that will work on Windows, Solaris, RedHat, Debian, Centos, and probably most other OS.
It includes a large number of widgets, a comprehensive event model, and has a large and established user-base, with lots of mailing lists, usenet groups, and suport websites.
However, the documentation is sparse, and assumes a familliarity not only with Perl - which is fair - but with TK, which is perhaps not so fair. Much of the essential Core documentation contains sections marked 'TODO' and 'This Document Lacks...,' and has done for many years. This often leads me to a close examination of the source code, which is badly formatted, completely ignoring perldoc perlstyle in favour of what I presume is Tk style. What's more, Perl Tk experts are known to snottily "correct" the standard perlstyle of non-Tk extensions in favour of their own style.
Finally, the graphic output of Tk is extremely dated, and skinning is far from trivial.
If you cannot avoid Perl Tk, purchasing a book on the subject would surely be a good investment. If you can avoid Perl Tk, do so, in favour of a less antique.
See also: Wx
This review is based on using Tk for a project two years ago.
The reason the project used Tk over Wx is that it was the only thing that ran on our Windows machines. (We wanted to use something that was OS-independent, but most clients had Windows.)
The calling style is very un-Perlish. It's not even C-ish. It's Tcl-ish. Preceding argument names with dashes is a serious annoyance, especially when you are dynamically generating widgets from code templates. It's a struggle to keep code form looking like unreadable spaghetti code.
Generating widgets form code templates (that is, subroutines which generate more subroutines) was painful.
Argument names were not intuitive. The documentation was poor, and required consultation with the Mastering Perl/Tk book and a lot of searching on the Internet for examples. Some settings just never worked.
It took a lot of experimentation to learn how to use the different layout managers so that the windows were aesthetically pleasing. The code seemed kluge-fulled. Even then, the actual application looked like a no-frills X-windows application, rather than a native Windows (or Mac, or Gnome) application.
If I were to name the most ingenious CPAN module, then I'd not hesitate to name Tk.
All the pitfalls of Tk (such as failing tests on installation, slightly scattered documentation, complexity in usage) are by far outweighted by its immens power and flexibility.
Each time I have to do something involving Tk, I have to find my way through the many classes. However, once I have identified which things I need and how they interact with each other, the programming itself is pure joy. In the end you just need a few lines of code to create an extremely powerful application.