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

ttk LabeledScale: label covered by hidden element #84400

Closed
StephenBell mannequin opened this issue Apr 7, 2020 · 7 comments
Closed

ttk LabeledScale: label covered by hidden element #84400

StephenBell mannequin opened this issue Apr 7, 2020 · 7 comments
Labels
3.8 only security fixes 3.9 only security fixes 3.10 only security fixes topic-tkinter type-bug An unexpected behavior, bug, or error

Comments

@StephenBell
Copy link
Mannequin

StephenBell mannequin commented Apr 7, 2020

BPO 40219
Nosy @terryjreedy, @serhiy-storchaka, @miss-islington, @E-Paine
PRs
  • bpo-40219: Lowered ttk LabeledScale dummy #21467
  • [3.9] bpo-40219: Lowered ttk LabeledScale dummy (GH-21467) #23788
  • [3.8] bpo-40219: Lowered ttk LabeledScale dummy (GH-21467) #23789
  • Files
  • lbscl.diff
  • 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 2020-12-19.17:29:36.027>
    created_at = <Date 2020-04-07.20:42:55.470>
    labels = ['3.8', 'type-bug', 'expert-tkinter', '3.9', '3.10']
    title = 'ttk LabeledScale: label covered by hidden element'
    updated_at = <Date 2020-12-19.17:29:36.027>
    user = 'https://bugs.python.org/StephenBell'

    bugs.python.org fields:

    activity = <Date 2020-12-19.17:29:36.027>
    actor = 'serhiy.storchaka'
    assignee = 'none'
    closed = True
    closed_date = <Date 2020-12-19.17:29:36.027>
    closer = 'serhiy.storchaka'
    components = ['Tkinter']
    creation = <Date 2020-04-07.20:42:55.470>
    creator = 'Stephen Bell'
    dependencies = []
    files = ['49227']
    hgrepos = []
    issue_num = 40219
    keywords = ['patch']
    message_count = 7.0
    messages = ['365940', '366184', '371352', '371390', '383092', '383093', '383388']
    nosy_count = 5.0
    nosy_names = ['terry.reedy', 'serhiy.storchaka', 'miss-islington', 'Stephen Bell', 'epaine']
    pr_nums = ['21467', '23788', '23789']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue40219'
    versions = ['Python 3.8', 'Python 3.9', 'Python 3.10']

    @StephenBell
    Copy link
    Mannequin Author

    StephenBell mannequin commented Apr 7, 2020

    The LabeledScale in tkinter.ttk seems to have some kind of hidden element that covers the LabeledScale's label when the value is set to mid-scale. Tested on Windows 10, Python 3.6

    See below code to reproduce:

    import tkinter
    from tkinter import ttk
    
    master = tkinter.Tk()
    _out1Value = tkinter.IntVar(master)
    out1Slider = ttk.LabeledScale(master, from_=-100, to=100, variable=_out1Value, compound="bottom")
    _out1Value.set(0)

    # uncomment to "fix"
    # out1Slider.label.lift()

    out1Slider.pack()
    
    master.mainloop()

    @StephenBell StephenBell mannequin added topic-tkinter type-bug An unexpected behavior, bug, or error labels Apr 7, 2020
    @terryjreedy
    Copy link
    Member

    3.6 only get security fixes, but your nice minimal, complete verifiable example let me verify easily on 3.9a5 with tk 8.6.9 and 3.6 with 8.6.6 and 2.7.17 with 8.5.19. The hidden element appears to be something like'||' with only part visible, depending on the scale value. It at least partly obscures from -20 to 15. (Clicking the bar moves 1 unit at a time.) This should be tested on other systems, but I suspect that this is an upstream tcl/tk issue.

    @terryjreedy terryjreedy added 3.7 (EOL) end of life 3.8 only security fixes 3.9 only security fixes labels Apr 11, 2020
    @E-Paine
    Copy link
    Mannequin

    E-Paine mannequin commented Jun 12, 2020

    This is indeed a tkinter issue and is caused by the placeholder label. As the main label is added to the frame using the place manager, this placeholder is required to make the frame the correct height.

    I have attached a small diff which lowers this placeholder, fixing the problem (raising the main label does the same thing).

    @terryjreedy
    Copy link
    Member

    Right. LabelScale is a tkinter.ttk extension, like OptionMenu. If I do the PR, I would call the placeholder 'dummy' since it is permanent (not removed after initialization). I'd like to see what happens without it and expand the comment to a line like
    # Dummy needed to ... .

    @E-Paine E-Paine mannequin added 3.10 only security fixes and removed 3.7 (EOL) end of life labels Jul 13, 2020
    @serhiy-storchaka
    Copy link
    Member

    New changeset b9ced83 by E-Paine in branch 'master':
    bpo-40219: Lowered ttk LabeledScale dummy (GH-21467)
    b9ced83

    @miss-islington
    Copy link
    Contributor

    New changeset 13d40c2 by Miss Islington (bot) in branch '3.8':
    bpo-40219: Lowered ttk LabeledScale dummy (GH-21467)
    13d40c2

    @serhiy-storchaka
    Copy link
    Member

    New changeset 6ad5fd1 by Miss Islington (bot) in branch '3.9':
    bpo-40219: Lowered ttk LabeledScale dummy (GH-21467) (GH-23788)
    6ad5fd1

    @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 3.9 only security fixes 3.10 only security fixes topic-tkinter type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants