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 patthoyts
Recipients patthoyts
Date 2020-11-12.00:27:53
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
When cloning a ttk style it is useful to copy an existing style and make changes. We can copy the configuration and layout using:

    style.layout('Custom.TEntry', **style.layout('TEntry'))
    style.configure('Custom.TEntry', **style.configure('TEntry))

However, doing this with can result in an exception. An example of this occurs for any style that has a defined default state in the map eg the TNotebook.Tab in the clam theme:

    [('selected', '#dcdad5'), ('#bab5ab',)]

However, calling Tk directly:

    (<StateSpec object: 'selected'>, '#dcdad5', <StateSpec object: ''>, '#bab5ab')

The second pair is defining the default state ('') to use color #bab5ab but this is being mangled by the code that converts this into pythons response.

The culprit is ttk._list_from_statespec which treats the statespec with the empty string as None and drops it and then returns the value in place of the state and then puts in an empty value.
Date User Action Args
2020-11-12 00:27:54patthoytssetrecipients: + patthoyts
2020-11-12 00:27:54patthoytssetmessageid: <>
2020-11-12 00:27:54patthoytslinkissue42328 messages
2020-11-12 00:27:53patthoytscreate