classification
Title: ttk LabeledScale: label covered by hidden element
Type: behavior Stage: resolved
Components: Tkinter Versions: Python 3.10, Python 3.9, Python 3.8
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: Stephen Bell, epaine, miss-islington, serhiy.storchaka, terry.reedy
Priority: normal Keywords: patch

Created on 2020-04-07 20:42 by Stephen Bell, last changed 2020-12-19 17:29 by serhiy.storchaka. This issue is now closed.

Files
File name Uploaded Description Edit
lbscl.diff epaine, 2020-06-12 10:52
Pull Requests
URL Status Linked Edit
PR 21467 merged epaine, 2020-07-13 19:41
PR 23788 merged miss-islington, 2020-12-15 19:43
PR 23789 merged miss-islington, 2020-12-15 19:43
Messages (7)
msg365940 - (view) Author: Stephen Bell (Stephen Bell) Date: 2020-04-07 20:42
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()
msg366184 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2020-04-11 03:02
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.
msg371352 - (view) Author: E. Paine (epaine) * Date: 2020-06-12 10:52
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).
msg371390 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2020-06-12 16:05
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 ... .
msg383092 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2020-12-15 19:43
New changeset b9ced83cf427ec86802ba4c9a562c6d9cafc72f5 by E-Paine in branch 'master':
bpo-40219: Lowered ttk LabeledScale dummy (GH-21467)
https://github.com/python/cpython/commit/b9ced83cf427ec86802ba4c9a562c6d9cafc72f5
msg383093 - (view) Author: miss-islington (miss-islington) Date: 2020-12-15 20:02
New changeset 13d40c2a418116797eccd77bd65e4dbd689008db by Miss Islington (bot) in branch '3.8':
bpo-40219: Lowered ttk LabeledScale dummy (GH-21467)
https://github.com/python/cpython/commit/13d40c2a418116797eccd77bd65e4dbd689008db
msg383388 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2020-12-19 17:29
New changeset 6ad5fd14825fc6039a9684dfdc14f5d12b86e25f by Miss Islington (bot) in branch '3.9':
bpo-40219: Lowered ttk LabeledScale dummy (GH-21467) (GH-23788)
https://github.com/python/cpython/commit/6ad5fd14825fc6039a9684dfdc14f5d12b86e25f
History
Date User Action Args
2021-01-24 21:09:36serhiy.storchakalinkissue43018 superseder
2020-12-19 17:29:36serhiy.storchakasetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2020-12-19 17:29:08serhiy.storchakasetmessages: + msg383388
2020-12-15 20:02:06miss-islingtonsetmessages: + msg383093
2020-12-15 19:43:37miss-islingtonsetpull_requests: + pull_request22646
2020-12-15 19:43:30miss-islingtonsetnosy: + miss-islington
pull_requests: + pull_request22645
2020-12-15 19:43:19serhiy.storchakasetmessages: + msg383092
2020-07-13 19:46:18epainesetversions: + Python 3.10, - Python 3.7
2020-07-13 19:41:31epainesetstage: patch review
pull_requests: + pull_request20613
2020-06-12 16:05:17terry.reedysetmessages: + msg371390
2020-06-12 10:52:17epainesetfiles: + lbscl.diff

nosy: + epaine
messages: + msg371352

keywords: + patch
2020-04-11 03:02:43terry.reedysetnosy: + terry.reedy, serhiy.storchaka

messages: + msg366184
versions: + Python 3.7, Python 3.8, Python 3.9, - Python 3.6
2020-04-07 20:47:54Stephen Bellsettype: behavior
2020-04-07 20:42:55Stephen Bellcreate