Good-looking Tk

Game engine illustrates toolkit advantages

By  

Tk looks good. I've had a lot of conversations over the last week, in response to the earlier entries, "Tk is my favorite toolkit" and "Take advantage of Tk", in this series on the toolkit. I recognize there are sincere people who truly find it unsatisfying or even "ugly". After looking over the evidence this week, though, I just don't get it: Tk looks fine to me.

Let's wrap up the current dialogue on Tk for now with a few graphical examples. Then I'll explain a bit of my philosophy in graphical user interface (GUI) work with illustrations from Tk, which also will serve as a foundation for next week's series on my other favorite GUI toolkit. Keep your comments coming; I'm likely to return to the subject of Tk early in 2010, and, in the meantime, I'll answer specific questions in the comments below.

Good-looking graphics

What do I mean when I praise Tk's appearance? Steve Havelka's Brick illustrates my point nicely. Brick is an engine for lo-fi video games; it's not designed to stun you with breath-taking animation or subtle ray-tracing (although it probably could be extended in those directions). Brick is impressive, though, in achieving pleasing effects with just a few lines of code. It makes prototyping a complete game a realistic project for an evening.

Tk's expressivity also helps with basic widgetry. As best I can tell, many of Tk's critics are looking at old, old applications; they completely miss out on the theming that Tk has enabled for several years.

GUI intelligence

Much of my own attention in working with GUIs, as I've already mentioned, goes to what I call "intelligence", or, if you prefer, "civility". A good GUI should adjust in real time to be a good partner to the human user trying to make the most out of it. "Graying out" (disabling) selections that don't make sense at the moment is intelligent; teasing a user with menu choices, only to tell him or her, "you don't have permission to view this now", is simply rude.

While this general idea of interface intelligence is now common in development circles, far less well-known are Tk's tags and traces, constructs which are almost unique to Tcl, but powerful in expressing and programming the flexibility and intelligence a good GUI should have.

Join us:
Facebook

Twitter

Pinterest

Tumblr

LinkedIn

Google+

Answers - Powered by ITworld

ITworld Answers helps you solve problems and share expertise. Ask a question or take a crack at answering the new questions below.

Join us:
Facebook

Twitter

Pinterest

Tumblr

LinkedIn

Google+

Ask a Question