Software

Tk is my favorite GUI toolkit

Cross-platform user interface stays fresh

November 11, 2009, 02:23 PM — 

I like to program graphical user interfaces (GUIs) with Tk; it's one of my two favorite GUI toolkits. I'll give several tips about GUI construction with Tk. I suspect at last some of this will apply to you. Next week, "Smart Development" will do the same for my other favorite GUI toolkit.

Understand, first, that a posting like this can achieve no more than a few tips. As much as I appreciate clarity and simplicity, a majority of the writing on programming that people apparently find persuasive is woefully truncated. Look, for a quick example, at Tk 8.5 is better than wxWidgets on Windows". Author BIOSPUD writes well, in that he clearly explains himself: he explains his focus on cross-platform capabilities (where Tk does indeed shine), he lucidly describes the dimensions along which he compares Tk, Swing, and wxWindows, he specifies crucial details (such as release number), and so on.

And he still covers only a small fraction of what there is to know. My impression of BIOSPUD is that he's aware of this. I've heard readers react to such articles, though, and they seem to internalize a post like his as, "Tk roolz!", without recognition that:

  • the comparison doesn't touch on such important toolkits as Qt, GTK, and .NET;
  • Tk has already moved on to 8.6 for production, wxWidgets has development snapshots at 2.9.0, and so on;
  • there's no discussion of performance or features;
  • there's little mention of the compatibility of the toolkits with different languages;

and so on. Modern toolkits are big, highly-evolved constructions, essentially all of which embed at least a decade of experience. Even full-length books--an outstanding one on Tcl/Tk just hit the bookshelves--can cover only a fraction of what there is to know.

The conclusion? Choice of a GUI toolkit is complex. Every toolkit has a lot to recommend it, and every one has defects. You're only deceiving yourself if you think you've found the absolute best. What we can do, though, is talk meaningfully about the situations where different ones shine, and how to make the best use of each toolkit in different circumstances.

While I'm not surprised that Tk correctly handles the font measurements BIOSPUD describes, I certainly wasn't aware of the specific comparison that seems so important to him.

Sign up for ITworld's Daily newsletter
Follow ITworld on Twitter @IT_world

I like it!
Comments

Tk's "tile" is a major enhancement with native/styled look

It's called "Tile" and ships with 8.5 and 8.6
http://wiki.tcl.tk/tile
| reply

GHD

GHD
| reply
peer-to-peer

Brian Proffitt
Microsoft/Novell: Breaking Down the Coupon Numbers

Esther Schindler
Drupal's Dries Buytaert on Building the Next Drupal

Tom Henderson
Top Ten General Operating Systems Rants

pasmith
PS3 motion controller delayed; goes up against Project Natal

sjvn
Neolithic Windows security hole alive and well in Windows 7

claird
Perl source code comparison makes for good reading

James Gaskin
Learn How To Print Pages In Order with Ink Jet Printers

mikelgan
Cell phones don't create stress or interrupt much

Sandra Henry-Stocker
How to: The Unix Interview

 

Where Google Chrome security fails: the password
I heard mention that the Chrome OS will have some sort of encryption available a la bitlocker. If it's possible to encrypt personal data using another password or key, then it may have potential for very secure data.... And Ubuntu has an 'encrypt home directory' option, perhaps google should follow suit.
- Dann

Join the conversation here

The Daily Tip

The Daily TipQuick, practical advice for IT pros. Made fresh daily.

Hot tips:

Want to cash in on your IT savvy? Send your tip to tips@itworld.com. If we post it, we'll send you a $25 Amazon e-gift card.

Newsletters

Subscribe to ITWORLD TODAY and receive the latest IT news and analysis.

I would like to receive offers via email from ITworld partners.
By clicking submit you agree to the terms and conditions outlined in ITworld's privacy policy.
Marketplace