Version 9 of User Interface Design for Tcl/Tk

Updated 2005-05-01 01:52:49

EKB created this page as a place to discuss user interface design using Tcl/Tk and to give examples. The intended focus is on GUI design with Tk (but this is a Wiki, so that might change). It's meant to compliment Tk coding styles and philosophies by focusing on the user experience.


General Principles

There are several good sources on user interface design. One is Joel Spolsky's User Interface Design for Programmers [L1 ], which includes text from his book of the same title. A pair of concepts from this source that I've found very useful is:

  • A UI is well designed when the computer model matches the user model.
  • The user model is very simple.

That is, a user approaches a program interface with some idea of what to expect. They have a "model" of the program, and hope that their model matches what the program will do. The computer also has a model of the software, expressed in code, that corresponds exactly to what the program will do. The user will have a better experience (and the programmer have happier users) if they are in agreement.

Sometimes the computer model is complicated by nature. In these cases the UI can provide metaphors (actually similes, but "metaphor" is the term of choice) and affordances. A metaphor is a representation of something already familiar to the user (a "desktop", a "spreadsheet", a "file system"), but is only similar enough to the actual item to orient users, not to recreate the item itself. An affordance is something that suggests how it should be used (e.g., buttons, entry widgets, tabbed dialogs, the little ridged "gripper" at the bottom right of windows in Windows).


Nitty Gritty

For a sometimes amusing look at poorly-designed interfaces, see the User Interface Hall of Shame [L2 ]. (The site itself is no longer active - this is an archived copy.)


Common UI Design Errors

It is easy to make a UI in Tcl/Tk. Unfortunately, it is also easy to make poor user interfaces in Tcl/Tk. With a little effort, they can be made much nicer.

For now, I'm just going to list a few errors that spring to mind

  • Inconsistent button sizes
  • No padding/inconsistent padding, so things looked "crushed"
  • Inconsistent tab order
  • GUI elements don't line up (e.g., entry widgets jump all over the place)
  • Unclear wording (Specifically, writing from the programmer's point of view rather than the user's point of view.)
  • Unrelated items are grouped close together/Related items are separated
  • The program overrides the system settings
  • Poor support for keyboard alternatives to GUI elements

Some more subtle considerations

  • Designing interfaces for internationalization (e.g., making sure that the interface resizes properly when the language changes)

TV Well I'm sure the 2 points about the models are in line with my Electrical Engineering masters' thesis, wherein what I wrote made sense, but what is this 'User model' ?

The error list sounds pretty much like rubbish to me, who cares about shrinking buttons compared to the freedom to at least make a window smaller when one wants, to, who sais all people want padding, who decides on what is 'inconsistent', why is lining up required, maybe those articles in a newspaper layout look fine with people for instance, why are so many people interested in Linux, where historically al lot of communication takes place with very short commands and messages, which fits on one screen easier, what's wrong with a program choosing it's own distinctive settings, and why would it be an error to have not keyboard shortcuts, it sounds more like an omission. Internationalisation and such sound less important than some UI that works at least and does something usefull instead of acting as a style council implemented.

There are very strong courses and books at top computer engineering level about OS'es (Lets say Tanenbaum or something), less strong but profound enough material about 'datastructures and algoritms', very good and scientifically relevant book about Computer Graphics (I'm and expert in the field and I made commercial very up to standard and more 'normal' GUI's already in the time of the Atari ST) both 2D and 3D, but is seems to me general UI courses are doomed to either be like the windows certification moloch, a redo or simply ripping of of principles of let's say what the macIntosh computer seems to preach to us (which usually is quite bearable), or hopefully something uplifting about nice principles, interaction times, resolution considerations (most well designed user interfaces look bad and work like crap on a high resolution screen like a 1600x1200 one I prefer, which however makes not for good general use contemporary screendumps on web pages), or an interesting vision, or maybe some fun stuff.

Like the 'Global Scenario Group' appears to me as a 30 year late ridiculous New Age (with all the adverse purposes) redo of the original and relevant 'group of rome', I'd say its not a very supreme idea to make something like a highschool course with rules about the schoolnewspaper layout without proper knowledge about why for example the campbell soup style from Warhole looks like it looks in the adds in it.


Category Design