[Tkinter-discuss] Graying out and disabling widgets that are not selected

Jeff Epler jepler at unpythonic.net
Wed Apr 14 20:57:45 EDT 2004


Let me for a moment take the role of a naysayer.

If something in your program's user interface isn't seen in standard
applications, and it takes a paragraph to explain, it's probably not a
good idea.

The behavior you describe doesn't say how to get back to the state where
another of the 3 items can be chosen, after the user first interacts
with one of the widgets.

In today's user interfaces, the standard way to choose among
alternatives is the radiobutton.  In fact, this reminds me of the proxy
settings dialog in various incarnations of Netscape and Mozilla.  In
this setup, three radiobuttons control the state of a number of other
widgets which are grouped below the radiobutton that enables them.  You
can see a screenshot of this screen at 
    http://texturizer.net/firefox/options.html#connection

The radiobuttons offer a clear solution to both problems I posed:  There
is a clear way to "undo" the selection of a particular widget, and there
is a clear visual relationship between the radiobuttons and the widgets
they control.  I'm not convinced this is a *great* solution, but the
strange thing about sins of user interface design is that they're less
sinful the more frequent they are.

If you use this approach, you can either use the command= of the
radiobuttons to enable and disable the other widgets, or you can use an
IntVar and trace_variable so you get a callback when the value is changed.

Jeff



More information about the Tkinter-discuss mailing list