Code by Kevin
   


About
Code by Kevin: Programming, code, business, and other pursuits

Your Host
Kevin Walzer, software developer.

Home

Subscribe to RSS Feed
Get a syndicated feed of my weblog.

Archives
2010
2009
2008
2007
2006

Categories
Business
Software
General

        home
Mon, 04 May 2009

More than skin deep

I get inspiration for GUI design from some unlikely sources:

This homely screenshot is from PgAccess, a now-defunct Tcl/Tk GUI for the PostgreSQL database. You may wonder why I draw inspiration from a database GUI that uses ugly icons, and seems more at home on Unix than on the Mac.

The reason is that this user interface, although not as slick as what you typically see on the Mac, is considered examplary in the Tcl/Tk community for the quality of its UI design. Here's what I like about it:

  • It's easy to navigate, using a clean, two-paned interface and a toolbar. You can select various aspects of the database from the tree display on the left, and view them in the table display on the right. Plenty of Mac applications use this paned interface, for good reason.

  • There's a lot of attention to detail. The icons, while dated and ugly, are nontheless functional: they are carefully chosen to invoke the category they represent. The "Tables" icon shows a table icon. The "Indexes" icons shows an "i" icon. The "Languages" icon shows a book. And so on. It's surprising how many programs, even on the Mac, pay little attention to these kinds of details.

  • The code libraries used to build the GUI are readily available to developers, and relatively easy to learn and use. This is, perhaps, less obvious to the user, but the key libraries here are the BWidget Tree and the Tablelist table view--stable, long-running, and widely-used Tcl/Tk extension widgets.

    The example of PgAccess is a major reason why I incorporated these particular widgets in my applications: see this entry for an example of how I use them in my programs to implement Cocoa-style GUI's in my programs. The fact that PgAccess hardly looks like a Mac application doesn't mean much; the cosmetic aspect is actually the easiest one to deal with. Using more modern, Mac-style icons, setting colors and spacing accordingly, and you get very close to Mac conventions without too much effort.

    I have considered using other widgets in my apps. BWidgets is not actively developed anymore, and it's quirky--some parts of it are powerful, such as the tree, but other parts of it are broken and nearly unusable. Tablelist is actively developed, and is one of the simplest-to-use and best-documented Tk widgets available--it has earned its considerable popularity among Tcl/Tk developers. However, it is most useful for simple list displays, and can't do certain things that other widgets can, for instance blending a tree and list display in the same view. (See the Finder for an example of how this works.) Also, both widgets are script-level (Tcl-based) widgets, and thus are slower than widgets coded in C, a compiled language.

    TkTreeCtrl is an extremely fast, powerful widget code in C that can do just about anything you want, but it is enormously complex. (The tutorial for TkTreeCtrl is intimidating in itself.) TkTreeCtrl is widely used in commercial Tk applications with complex GUI's, but it is probably overkill for my needs; also, as a binary extension that requires compilation, it's not clear whether it will work with the forthcoming Tk-Cocoa branch of Tcl/Tk.)

    Another, somewhat less complex widget is the ttk::treeview widget that is new in Tcl/Tk 8.5. It can provide a tree, list, and combination view, something that neither the BWidget or Tablelist libraries can. It also compiles just fine with Tk-Cocoa. However, the ttk::treeview widget lacks some important functionality that comes out of the box with Tablelist, such as sorting of data in the display. Tablelist supports this with a single command, but a developer has to add this to ttk::treeview. Also, ttk::treeview lacks visual cues to indicate when data is sorted, such as an up-or-down arrow in the column view. Again, Tablelist includes this out-of-the-box. Finally, it's not clear to me how configurable ttk::treeview is; developers' general experience with the ttk themed widgets is that they are great in their default values (they are designed to conform to platform conventions out of the box), but they are much harder to customize.

    Given that I'm able to do nearly everything I want to with BWidgets and Tablelist, it's likely I will continue to live with their minor drawbacks and use them in my applications. And I trace that all back to PgAccess--homely on the surface, but clean and designed with care.

    [/general] permanent link


  •