This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: tkinter style map return value in alt theme
Type: behavior Stage: resolved
Components: Tkinter Versions: Python 3.8
process
Status: closed Resolution: out of date
Dependencies: Superseder: ttk style.map function incorrectly handles the default state for element options.
View: 42328
Assigned To: Nosy List: misianne, serhiy.storchaka
Priority: normal Keywords:

Created on 2021-02-14 00:43 by misianne, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Messages (5)
msg386930 - (view) Author: misianne (misianne) Date: 2021-02-14 00:43
The return value for ttk.style().map('Treeview') is wrong for the 'background' value in the 'alt' theme: tuple are missing.

Tcl alt Treeview map:

-foreground {disabled #a3a3a3 {!disabled !selected} black selected #ffffff} 
-background {disabled #d9d9d9 {!disabled !selected} #ffffff selected #4a6984}


tkinter alt Treeview map:

{
'foreground': [('disabled', '#a3a3a3'), ('!disabled', '!selected', 'black'), ('selected', '#ffffff')], 
'background': ['disabled', '#d9d9d9', '!disabled !selected', '#ffffff', 'selected', '#4a6984']
}

It should be:

'background': [('disabled', '#d9d9d9'), ('!disabled !selected', '#ffffff'), ('selected', '#4a6984')]
msg386946 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2021-02-14 11:54
What is our OS and Python version. I cannot reproduce this on Linux, perhaps it is OS-specific.

Try to test with the latest Python release. Maybe this bug was fixed in issue42328.
msg386949 - (view) Author: misianne (misianne) Date: 2021-02-14 13:04
My os is windows 7, Python 3.8.6. 
Obviously, I can't test it on 3.9+.
msg386953 - (view) Author: misianne (misianne) Date: 2021-02-14 15:18
Tested W10 Python 3.9.1: map output is OK. It is a problem of Python 3.8.6 under W7.
msg386955 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2021-02-14 15:42
Tested on Python 3.8.6 and 3.8.7+, Windows 10. On 3.8.6 the bug is reproduced, on 3.8.7+ all works as expected.
History
Date User Action Args
2022-04-11 14:59:41adminsetgithub: 87383
2021-02-14 15:42:42serhiy.storchakasetstatus: open -> closed
superseder: ttk style.map function incorrectly handles the default state for element options.
messages: + msg386955

resolution: out of date
stage: resolved
2021-02-14 15:18:59misiannesetmessages: + msg386953
2021-02-14 13:04:30misiannesetmessages: + msg386949
2021-02-14 11:54:42serhiy.storchakasetnosy: + serhiy.storchaka
messages: + msg386946
2021-02-14 00:43:47misiannecreate