On 3/24/2017 2:51 AM, Arjen Markus wrote:
> On Friday, March 24, 2017 at 12:02:09 AM UTC+1, Dave wrote:
>> Win7x64 Tcl 8.6.6 compiled w/ msys2 64-bit gcc
>>
>> Why are the active{fore,back}ground options ignored while the other
>> options are not?
>>
>> option add *Table.Label.width 20
>> option add *Table.Label.activebackground lightblue
>> option add *Table.Label.activeforeground pink
>> option add *Table.Label.background blue
>> option add *Table.Label.foreground red
>>
>> frame .f -class Table -width 200 -height 500 -bg cyan
>> label .f.c1 -text One
>> label .f.c2 -text Two -state active
>>
>> pack .f
>> pack .f.c1 -side top -padx 25
>> pack .f.c2 -side top -padx 25
>>
>> --
>> computerjock AT mail DOT com
>
> From the man page:
>
> Specifies background color to use when drawing active elements. An element (a widget or portion of a widget) is active if the mouse cursor is positioned over the element and pressing a mouse button will cause some action to occur. If strict Motif compliance has been requested by setting the tk_strictMotif variable, this option will normally be ignored; the normal background color will be used instead. For some elements on Windows and Macintosh systems, the active color will only be used while mouse button 1 is pressed over the element.
>
> How did you make the label "active"?
>
I had assumed that the .f.c2 "-state active" would have done it. I had
hoped that -state would have allowed me to easily switch between two
color schemes. I got that impression from the "-state" docs for label:
Command-Line Name: -state
Database Name: state
Database Class: State
Specifies one of three states for the label: normal, active, or
disabled. In normal state the button is displayed using the -foreground
and -background options. In active state the label is displayed using
the -activeforeground and -activebackground options. In the disabled
state the -disabledforeground and -background options determine how the
button is displayed.
Thank you for the explanation. IMO the docs can lead to confusion.