O'Reilly logo

Practical Programming in Tcl & Tk, Third Edition by Brent B. Welch

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Buttons Associated with Tcl Variables

The checkbutton and radiobutton widgets are associated with a global Tcl variable. When one of these buttons is clicked, a value is assigned to the Tcl variable. In addition, if the variable is assigned a value elsewhere in the program, the appearance of the checkbutton or radiobutton is updated to reflect the new value. A set of radiobuttons all share the same global variable. The set represents a choice among mutually exclusive options. In contrast, each checkbutton has its own global variable.

The ShowChoices example uses a set of radiobuttons to display a set of mutually exclusive choices in a user interface. The ShowBooleans example uses checkbutton widgets:

Example 27-4 Radiobuttons and checkbuttons. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required