Tk Source Code

View Ticket
Login
Ticket UUID: d1d4286ddaad47daef8c187cc5596f7e34b238d2
Title: ttk::scrollbar behaves differently than tk::scrollbar on win32
Type: Bug Version: 8.6
Submitter: drey08 Created on: 2013-08-03 14:45:10
Subsystem: 88. Themed Tk Assigned To: jenglish
Priority: 5 Medium Severity: Minor
Status: Open Last Modified: 2016-08-22 12:24:34
Resolution: None Closed By: nobody
    Closed on:
Description:
Here's a small test-case showing the behavior of 'tk::scrollbar':

-----
package require Tk

wm geometry . 300x200+50+50

tk::listbox .listbox -yscrollcommand ".scrollbar set" -height 5
tk::scrollbar .scrollbar -command ".listbox yview" -orient vertical

grid .listbox -column 0 -row 0 -sticky nwes
grid .scrollbar -column 1 -row 0 -sticky ns
grid columnconfigure . 0 -weight 1
grid rowconfigure . 0 -weight 1

for {set i 0} {$i<100} {incr i} {
   .listbox insert end "Line $i of 100"
}
-----

Some notes:

- If using the left mouse button you click and hold below the scrollbar thumb, the scrollbar will move page by page until it reaches the location of the mouse cursor.

- The background area below the thumb will change color (usually into black).

But with the themed scrollbar (ttk::scrollbar), the behavior is different:

- When you click and hold below the scrollbar thumb, the scrollbar will move all the way to the bottom, it won't stop to the cursor position.

- The background area below the thumb does not change color.

It seems like ttk::scrollbar has the same issues as e.g. GTK's scrollbar on win32, it doesn't seem to act natively.