Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tkinter style map return value in alt theme #87383

Closed
misianne mannequin opened this issue Feb 14, 2021 · 5 comments
Closed

tkinter style map return value in alt theme #87383

misianne mannequin opened this issue Feb 14, 2021 · 5 comments
Labels
3.8 only security fixes topic-tkinter type-bug An unexpected behavior, bug, or error

Comments

@misianne
Copy link
Mannequin

misianne mannequin commented Feb 14, 2021

BPO 43217
Nosy @serhiy-storchaka
Superseder
  • bpo-42328: ttk style.map function incorrectly handles the default state for element options.
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2021-02-14.15:42:42.647>
    created_at = <Date 2021-02-14.00:43:47.161>
    labels = ['3.8', 'type-bug', 'expert-tkinter']
    title = 'tkinter style map return value in alt theme'
    updated_at = <Date 2021-02-14.15:42:42.646>
    user = 'https://bugs.python.org/misianne'

    bugs.python.org fields:

    activity = <Date 2021-02-14.15:42:42.646>
    actor = 'serhiy.storchaka'
    assignee = 'none'
    closed = True
    closed_date = <Date 2021-02-14.15:42:42.647>
    closer = 'serhiy.storchaka'
    components = ['Tkinter']
    creation = <Date 2021-02-14.00:43:47.161>
    creator = 'misianne'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 43217
    keywords = []
    message_count = 5.0
    messages = ['386930', '386946', '386949', '386953', '386955']
    nosy_count = 2.0
    nosy_names = ['serhiy.storchaka', 'misianne']
    pr_nums = []
    priority = 'normal'
    resolution = 'out of date'
    stage = 'resolved'
    status = 'closed'
    superseder = '42328'
    type = 'behavior'
    url = 'https://bugs.python.org/issue43217'
    versions = ['Python 3.8']

    @misianne
    Copy link
    Mannequin Author

    misianne mannequin commented Feb 14, 2021

    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')]

    @misianne misianne mannequin added 3.8 only security fixes topic-tkinter type-bug An unexpected behavior, bug, or error labels Feb 14, 2021
    @serhiy-storchaka
    Copy link
    Member

    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 bpo-42328.

    @misianne
    Copy link
    Mannequin Author

    misianne mannequin commented Feb 14, 2021

    My os is windows 7, Python 3.8.6.
    Obviously, I can't test it on 3.9+.

    @misianne
    Copy link
    Mannequin Author

    misianne mannequin commented Feb 14, 2021

    Tested W10 Python 3.9.1: map output is OK. It is a problem of Python 3.8.6 under W7.

    @serhiy-storchaka
    Copy link
    Member

    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.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.8 only security fixes topic-tkinter type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant