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 Pat Thoyts
Recipients Pat Thoyts, patthoyts, serhiy.storchaka, terry.reedy
Date 2020-11-14.23:32:22
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1605396742.86.0.540407154342.issue42328@roundup.psfhosted.org>
In-reply-to
Content
So if you look at the clamTheme.tcl file you can see the definition of the map for the TNotebook.Tab style looks like the following:

    ttk::style map TNotebook.Tab \
      -padding [list selected {6 4 6 2}] \
      -background [list selected $colors(-frame) {} $colors(-darker)] \
      -lightcolor [list selected $colors(-lighter) {} $colors(-dark)] \
      ;

The vista theme uses these too on Windows.

So calling this from script we can see the resulting empty elements in tcl:

    % ttk::style map TNotebook.Tab
    -lightcolor {selected #eeebe7 {} #cfcdc8} -padding {selected {6 4 6 2}} -background {selected #dcdad5 {} #bab5ab}

As I put in the bug, this gets mistranslated in python with the value for that state map element getting put into the first element.

The simplest demonstration is that the following raises an exception:

    import tkinter as tk
    import tkinter.ttk as ttk
    style = ttk.Style()
    style.theme_use('clam')
    style.map('Custom.TNotebook.Tab', **style.map('TNotebook.Tab'))
History
Date User Action Args
2020-11-14 23:32:22Pat Thoytssetrecipients: + Pat Thoyts, terry.reedy, serhiy.storchaka, patthoyts
2020-11-14 23:32:22Pat Thoytssetmessageid: <1605396742.86.0.540407154342.issue42328@roundup.psfhosted.org>
2020-11-14 23:32:22Pat Thoytslinkissue42328 messages
2020-11-14 23:32:22Pat Thoytscreate