TIP #110 Version 1.6: Add a Tristate Mode to the Checkbutton and Radiobutton

This is not necessarily the current version of this TIP.


TIP:110
Title:Add a Tristate Mode to the Checkbutton and Radiobutton
Version:$Revision: 1.6 $
Author:Brian Griffin <bgriffin at model dot com>
State:Draft
Type:Project
Tcl-Version:9.0
Vote:Pending
Created:Tuesday, 01 October 2002

Abstract

This TIP proposes adding a third value (tristate) to the -state option of the checkbutton and radiobutton widgets.

Rationale

In order to meet more demanding requirements of todays complex graphical user interfaces, it would help add to the functionality of the basic checkbutton and radiobutton widgets. To support using checkbuttons and radiobuttons along with multiple selection, it is necessary for the checkbutton to be able to display a third state, i.e., both On and Off. This indicates the situation where a property has a particular value for some members of a multiple selection, but not others.

Proposed Change

The change would add a the state "tristate" to the -state option of the checkbutton and radiobutton widgets. The widget would then display the check/dot mark (as appropriate) along with a "grayed" background. When the checkbutton or radiobutton is invoked (i.e. clicked on) it would behave exactly as it does currently with the addition of modifying the -state from "tristate" to "normal".

There is a concern that the Unix version of these widgets do not have a sufficiently different appearance when in the tristate state compared with the On and Off states. This issue is addressed in TIP #109.

Amended Proposal

The original proposal is confusing in that it mixes state (normal, disabled) with values (on, off). The original intent is to give the widget a display presentation that represents a third value which is both on and off at the same time, also known as an indeterminate value. To make this clear now and for future users of the checkbutton, I amend the proposed changes to be:

  1. Identify a third, platform specific, presentation (e.g. check with grayed background) to represent the tristate or indeterminate value,

  2. Add the option "-tristatevalue" to specify the match value only. The default value of this option will be {},

  3. Change the behavior to display the indeterminate or tristate presentation when the associated variable's value matches the -tristatevalue, and

  4. Add the option "-tristateimage" to specify an image to display (in place of the image option) when the checkbutton has the indeterminate value (as defined above.)

Copyright

This document has been placed in the public domain.


Powered by TclThis is not necessarily the current version of this TIP.

TIP AutoGenerator - written by Donal K. Fellows