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.

Author mrabarnett
Recipients gpolo, guillaumeb, mrabarnett, ned.deily, serhiy.storchaka
Date 2019-05-16.23:20:49
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1558048850.03.0.427232203271.issue36468@roundup.psfhosted.org>
In-reply-to
Content
I've just come across the same problem.

For future reference, adding the following code before using a Treeview widget will fix the problem:

def fixed_map(option):
    # Fix for setting text colour for Tkinter 8.6.9
    # From: https://core.tcl.tk/tk/info/509cafafae
    #
    # Returns the style map for 'option' with any styles starting with
    # ('!disabled', '!selected', ...) filtered out.

    # style.map() returns an empty list for missing options, so this
    # should be future-safe.
    return [elm for elm in style.map('Treeview', query_opt=option) if
      elm[:2] != ('!disabled', '!selected')]

style = ttk.Style()
style.map('Treeview', foreground=fixed_map('foreground'),
  background=fixed_map('background'))
History
Date User Action Args
2019-05-16 23:20:50mrabarnettsetrecipients: + mrabarnett, gpolo, ned.deily, serhiy.storchaka, guillaumeb
2019-05-16 23:20:50mrabarnettsetmessageid: <1558048850.03.0.427232203271.issue36468@roundup.psfhosted.org>
2019-05-16 23:20:50mrabarnettlinkissue36468 messages
2019-05-16 23:20:49mrabarnettcreate