The cget Operation

All widgets support a cget operation that returns the current value of the specified configuration option. The following two commands are equivalent:

lindex [$w config option] 4
$w cget option
					

Nothing breaks with this change, but you should enjoy this feature.

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.