Tk Source Code

View Ticket
Bounty program for improvements to Tcl and certain Tcl packages.
Ticket UUID: e3eeb0102c61b088a15c6a13d560cc8ba9d8a196
Title: Scrollbar Text Widget macOS
Type: Bug Version: Latest
Submitter: Takamoto Created on: 2019-10-12 11:14:08
Subsystem: (unused) Assigned To: nobody
Priority: 5 Medium Severity: Minor
Status: Closed Last Modified: 2019-10-12 15:29:53
Resolution: None Closed By: Takamoto
    Closed on: 2019-10-12 15:29:53
I am experiencing problems with the scrollbar in a text widget with long text displayed and small scrollbar cursor:

- if the Window is on fullscreen the scrollbar cursor gets focus (and gets darker) when the mouse is way below it real position
- no matter if fullscreen or not, if the scrollbar cursor is in its smallest size, clicking on it does not get hold of the cursor, but it moves up or down the view as if one was clicking on the scrollbar (not on the cursor). 

I have not provided a code, as this is replicable with a basic Entry Widget and sufficient text in it.
User Comments: Takamoto added on 2019-10-12 15:29:53:
This has pointed me in the right direction! I am still not quite sure what was wrong, but with the latest commit (!) my application was pointing to an older version of Tk lost in the system. Thank you for the help! And for the GREAT job. I close the ticket.

marc_culler (claiming to be Marc Culler) added on 2019-10-12 14:16:30:
This behavior, where the scrollbar thumb is displayed in a different location
from where Tk thinks it is located, was fixed when the scrollbar was rewritten
to draw it directly rather than by using HITheme.  There are many lines of
comments about this in the code.

Since your toolbar buttons have reverted to looking like they used to look a year
ago, and your scrollbars have reverted to behaving like they did a year ago, I
suspect that you are not running the version of Tk that you built from the
current core-8-6-branch tip.  Some strange things can occur with Apple's launcher
when you have multiple apps with the same bundle identifier.  Please look around
for old versions of Tk.  And please make sure to completely remove the build
directory before building Tcl and Tk.

kevin_walzer added on 2019-10-12 14:07:12:
It would help to know what version of Tk you are using. If you are using the 8.6.9 release from last fall, the scrollbar might have displayed some of these behaviors -  some work has been done on it and it is improved in the current tip of 8.6 development.

Takamoto added on 2019-10-12 13:42:10:
It can not be the intended behaviour: in many cases you simply can not select the thumb scroller as in any other application

- because you can select it with the cursor not on it (but far below), this happens in full mode
- because when you try to select it (i.e. clicking on it to get 'hold' of it and start scrolling), this does not happen. Instead, the scrollbar behaves as if you where simply clicking on the scrollbar itself (and not on the cursor)

I may make a short video, if it helps.

kevin_walzer added on 2019-10-12 13:05:00:
I think what you are describing is the correct behavior of the scrollbar. If you select the thumb scroller directly, that allows line by line scrolling of the text widget. If you click in the trough, the scrollbar gets focus and the scrolling behavior is "paging" (larger chunks of text). If there are large amounts of text, the scrollbar gets smaller, and scrolling performance is slower, but this is still the intended/correct behavior.