classification
Title: TTK Treeview alternating row color not working
Type: behavior Stage: resolved
Components: Tkinter Versions: Python 3.7
process
Status: closed Resolution: third party
Dependencies: Superseder:
Assigned To: Nosy List: Mookiefer, zach.ware
Priority: normal Keywords:

Created on 2019-08-05 20:40 by Mookiefer, last changed 2019-08-05 21:00 by zach.ware. This issue is now closed.

Messages (2)
msg349071 - (view) Author: Christopher Caputo (Mookiefer) Date: 2019-08-05 20:40
The default installation of Python3.7 on all my Win10 machines has a ttk theme file that disables treeview alternating row colors. The specific file for me is "vistaTheme.tcl" located at "C:\Program Files\Python37\tcl\tk8.6\ttk". In the #Treeview section of the file the "ttk::style map Treeview" line needed to be changed from:

ttk::style map Treeview \
-background [list disabled $colors(-frame)\
{!disabled !selected} $colors(-window) \
selected SystemHighlight] \
-foreground [list disabled $colors(-disabledfg) \
{!disabled !selected} black \
selected SystemHighlightText]

Changed to:

ttk::style map Treeview
-background [list selected SystemHighlight]
-foreground [list selected SystemHighlightText]

Essentially all the "disabled" parts needed to be removed.
msg349074 - (view) Author: Zachary Ware (zach.ware) * (Python committer) Date: 2019-08-05 21:00
That file is part of Tcl/Tk and just bundled with Python on Windows; please raise an issue on the Tk issue tracker (which appears to be here: https://core.tcl-lang.org/tk/ticket).  If and when the change is released in a new version of Tcl/Tk, please feel free to open a new issue here requesting that we update to that version.
History
Date User Action Args
2019-08-05 21:00:49zach.waresetstatus: open -> closed

nosy: + zach.ware
messages: + msg349074

resolution: third party
stage: resolved
2019-08-05 20:40:23Mookiefercreate