Under Windows 7, the disabled state of the ttk::combobox is not very visible. When disabled, the down arrow is grayed out and there is a slight border change, but the background color of the text area is not changed, nor is the color of the text itself. This makes it difficult to determine the state of the widget at a glance.
Under Windows XP, in addition to the above visual cues, the background color of the text area and the button area are also changed.
The text color is not changed when the widget is disabled under either OS. This does not match the visual look of other disabled ttk widgets (entry, etc), where the text is grayed out also.
What does [winfo rgb . SystemGrayText] return?
> What does [winfo rgb . SystemGrayText] return?
On the Win7 box, I get:
3 % winfo rgb . SystemGrayText
28013 28013 28013
On the XP box, I get:
3 % winfo rgb . SystemGrayText
44204 43176 39321
Image of enabled/disabled combobox under Win 7
I just attached an image showing a row of enabled widgets and a row of disabled widgets (Win 7, tk 8.5.8). The top row is enabled and the bottom row is disabled.
Notice how, other than the arrow (and a subtle border change), the combobox widgets look nearly identical.
The last column contains an enabled and a disabled ttk::entry widget. Notice how the text color and background color differs, making the state much more obvious.
Found cause of problem; combobox has a dynamic setting for -foreground in {focus readonly} state in winnative and xpnative themes; neglected to re-specify setting for -foreground in disabled state.
Attached patch fixes; am unable to test since I don't have access to a Windows machine ATM.
Joe,
Glad you found the problem. I'm happy to test if I can, but I don't see the "attached patch fixes". Where can I find them?
Joe - never mind. I just needed to refresh my browser...
I've added the patch to the mentioned files but didn't see any change in the look of the disabled widgets. I also added the change to "vistaTheme.tcl", but again saw no difference.
Next, I added a "puts" statement inside the [namespace eval] block of each of the theme files to see which one was being loaded. It seems that none of the (3) theme files are being loaded by default. (I'm not specifying any particular theme in my code).
I can force my way through the code with a [ttk::setTheme], and I then see my [puts] statement issued. Also, I can just change the definition of the TCombobox from the console window (ttk::style map TCombobox ...].
In that case, I do see the grayed text on a disabled combobox, which looks much better. It still doesn't match the look of a disabled entry though, as the entry has a grayed background also, whereas the Combobox background is white. I'm not sure if the white background is intended or not.
Anyway, should I have to manually load a theme (I didn't think so)? If so, what's the proper theme for Win 7?
Thanks.
The code below was applied to 8.5 and HEAD and fixes the issue in winnative and xpnative.
The vista/win7 version has grey text but the background of the text is incorrect at the moment. Needs some alternate layout I suspect.