Button Operations

Table 27-2 summarizes the operations on button widgets. In the table, $w is a button, checkbutton, radiobutton, or menubutton, except when noted. For the most part, these operations are used by the script libraries that implement the bindings for buttons. The cget and configure operations are the most commonly used by applications.

Table 27-2. Button operations.
$w cget optionReturns the value of the specified attribute.
$w configure ?option? ?value? ...Queries or manipulates the configuration information for the widget.
$w deselectDeselects the radiobutton or checkbutton. Set the radiobutton variable to the null string. Set the checkbutton variable to the off value.
$w flashRedisplays the button several times in alternate colors. ...

Get Practical Programming in Tcl & Tk, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.