Tk is actually a very well-designed module. It's got a number of advantages over other Perl toolkits, including the following:
- Tk has no external dependencies (aside from Xlib on X11 systems; without Xlib, though, you won't have a very useful machine)
- Tk is very mature. There are two O'Reilly books, one newsgroup, and lots of Perl users who'd be glad to help you overcome any difficulties you might have.
- Tk is well-integrated into Perl. Other toolkits, like wxPerl and Gtk, are simple wrappers around other libraries. Tk is heavily based off Tcl/Tk, but its author, Nick Ing-Simmons, has added a lot of Perl-specific features to it. Instead of being a wrapper around Tcl/Tk, Perl/Tk is what its name suggests: a blending of Perl and Tcl/Tk.
- Portability. ActiveState offers a PPM for Tk, and it works on pretty much any UNIX system, since it doesn't need GNOME or wx.
I'm not too sure why you'd call the design confusing and ugly. I find it to be very scalable; it's equally simple to develop a barebones interface or to make an advanced widget with all kinds of bells and whistles. It requires a lot less code than Wx does, and is a little more Perlish for that. For instance, I can write and test a quick addition script in a matter of minutes with Tk:
use Tk;
$mw = MainWindow->new;
$e1 = $mw->Entry->pack;
$e2 = $mw->Entry->pack;
$sum = $mw->Label->pack;
$mw->Button(-text => 'Compute', -command => sub {
$sum->configure(-text => ($e1->get() + $e2->get()));
})->pack;
MainLoop;
In Wx, that would require all kind of infrastructure that isn't really necessary for such a simple script. Of course, There's More Than One Way to Do It, so that might be a good thing if that's the kind of stuff you're into.
I can definitely see your point about the appearance of Tk, but it doesn't have to be that way. See
my node about improving Tk's interface. Basically, try adding the following lines to the top of your app:
$mw->optionAdd("*font", "-*-arial-normal-r-*-*-*-120-*-*-*-*-*-*");
$mw->optionAdd("*borderWidth", 1);
Of course, replace $mw with whatever scalar you keep your MainWindow in. I think that the revised interface looks a lot better than the standard one.
I was trying to resist, but I can't help but make a shameless plug here. Download milkbone from
http://milkbone.org and take a look at the interface. It was created completely with Perl/Tk, but, IMHO, it looks as good as any other application.
So I would suggest giving Tk another look. It's actually a very nice piece of software to work with.
The computer can't tell you the emotional story. It can give you the exact mathematical design, but what's missing is the eyebrows.
- Frank Zappa