Previous section   Next section

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

Table of Contents
Chapter 37.  Tk Widget Attributes

The Focus Highlight

Each widget can have a focus highlight indicating which widget currently has the input focus. This is a thin rectangle around each widget that is displayed in the highlight background color by default. When the widget gets the input focus, the highlight rectangle is displayed in an alternate color. The addition of the highlight adds a small amount of space outside the border described in the previous section. The attributes in Table 37-3 control the width and color of this rectangle. If the width is zero, no highlight is displayed.

By default, only the widgets that normally expect input focus have a nonzero width highlight border. This includes the text, entry, and listbox widgets. It also includes the button and menu widgets because there is a set of keyboard traversal bindings that focus input on these widgets, too. You can define nonzero highlight thicknesses for all widgets except Macintosh buttons.

Table 37-3. Highlight attribute resource names.
highlightColorThe color of the highlight when the widget has focus.
highlightBackgroundThe highlight color when the widget does not have focus.
highlightThicknessThe width of the highlight border.

      Previous section   Next section