[New-bugs-announce] [issue33665] tkinter.ttk.Scrollbar.fraction() is inaccurate, or at least inconsistent compared to the non ttk version

pez report at bugs.python.org
Mon May 28 06:39:05 EDT 2018


New submission from pez <4coreylopez at gmail.com>:

tkinter.Scrollbar(orient='horizontal').fraction() gives you an accurate representation of how far along the mouse is in the trough. The output is 0.0 when the mouse is on the first pixel of the trough. The output is 1.0 when the mouse is on the last pixel of the trough.

tkinter.ttk.Scrollbar(orient='horizontal').fraction() believes the trough is 16 pixels shorter than it is. The output is 0.0 when the mouse is on the first pixel of the trough. However, the output is greater than 1.0 when the mouse is on the last pixel of the trough. This extra 16 pixels is static, so the behavior is the same regardless of how wide the scrollbar is.

While possibly coincidental, it's interesting that the 16 pixels is also close to the default width of the scrollbar.

This is happening for me on Windows 7.
Did not test vertical orientation.

----------
components: Tkinter
files: ttk_scroll_bug.py
messages: 317836
nosy: pez
priority: normal
severity: normal
status: open
title: tkinter.ttk.Scrollbar.fraction() is inaccurate, or at least inconsistent compared to the non ttk version
type: behavior
versions: Python 3.6
Added file: https://bugs.python.org/file47617/ttk_scroll_bug.py

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue33665>
_______________________________________


More information about the New-bugs-announce mailing list