mirror of
https://github.com/TomSchimansky/CustomTkinter.git
synced 2023-08-10 21:13:13 +03:00
fixed scrollbar for Windows
This commit is contained in:
@ -1,3 +1,5 @@
|
||||
import sys
|
||||
|
||||
from .ctk_canvas import CTkCanvas
|
||||
from ..theme_manager import ThemeManager
|
||||
from ..draw_engine import DrawEngine
|
||||
@ -196,5 +198,8 @@ class CTkScrollbar(CTkBaseClass):
|
||||
|
||||
def mouse_scroll_event(self, event=None):
|
||||
if self.command is not None:
|
||||
self.command('scroll', event.delta, 'units')
|
||||
if sys.platform.startswith("win"):
|
||||
self.command('scroll', -int(event.delta/40), 'units')
|
||||
else:
|
||||
self.command('scroll', -event.delta, 'units')
|
||||
|
||||
|
Reference in New Issue
Block a user