Version 6 of User Interface Design for Tcl/Tk

Updated 2005-04-30 01:15:38

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
    • Note: I'm not really thinking here about writing skills, but about 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

Category Design