Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Wx vs. Tk

by batkins (Chaplain)
on Oct 19, 2003 at 01:58 UTC ( [id://300345]=note: print w/replies, xml ) Need Help??


in reply to Wx vs. Tk

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

Replies are listed 'Best First'.
Re: Re: Wx vs Tx (OT) - milkbone
by zakzebrowski (Curate) on Oct 19, 2003 at 21:12 UTC
    Wrt your mikbone, (I browsed the faq / documentation and I didn't find out of the box support), could you support 'proxy' connections through non-standard ports? (Eg, I'm behind a firewall at work, and I couldn't get it to work because of it... though I still want to try it out at some point... If I tried to use port 23 for communication with aol it should work...) Otherwise cool points in your message. I have yet to dig into Tk (or wx) myself because I'm either developing code for the console or writing a web app for what I need to do...
    Cheers.


    ----
    Zak
    undef$/;$mmm="J\nutsu\nutss\nuts\nutst\nuts A\nutsn\nutso\nutst\nutsh\ +nutse\nutsr\nuts P\nutse\nutsr\nutsl\nuts H\nutsa\nutsc\nutsk\nutse\n +utsr\nuts";open($DOH,"<",\$mmm);$_=$forbbiden=<$DOH>;s/\nuts//g;print +;
      It's funny you should mention that, because that's exactly what I was working on today. :)

      The next release ought to include proxy support.


      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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://300345]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (6)
As of 2024-04-25 12:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found