@@ -57,7 +57,7 @@ def __init__(self, *args, **kwargs):
57
57
self ._canvas .yview_moveto (0.0 )
58
58
59
59
@property
60
- def frame (self ):
60
+ def frame (self ) -> ttk . Frame :
61
61
return self ._frame
62
62
63
63
def _show_scrollbars (self ):
@@ -109,7 +109,7 @@ def _peek_scrollbars(self, _event: tk.Event | None = None):
109
109
self ._show_scrollbars ()
110
110
self ._schedule_hide_scrollbars ()
111
111
112
- def _xview (self , * args , width : int | None = None ):
112
+ def _xview (self , action : str , fraction_or_amount : float | int , what : str | None = None , * , width : int | None = None ):
113
113
"""
114
114
Called when a horizontal scroll is requested. Called by other callbacks
115
115
(``_configure_viewport_explicit`` and ``_configure_viewport_implicit``)
@@ -118,11 +118,13 @@ def _xview(self, *args, width: int | None = None):
118
118
horizontal dimension. Otherwise, horizontally centre the contents of
119
119
the canvas.
120
120
121
- :param args: Passed to ``tkinter.Canvas.xview``.
122
- :param width: Width of the canvas.
121
+ :param action: First argument of ``tkinter.Canvas.xview``.
122
+ :param fraction_or_amount: Second argument of ``tkinter.Canvas.xview``.
123
+ :param what: Third argument of ``tkinter.Canvas.xview``.
124
+ :param width: Width of the canvas. Will be queried if ``None``.
123
125
"""
124
126
if self ._canvas .xview () != (0.0 , 1.0 ):
125
- self ._canvas .xview (* args )
127
+ self ._canvas .xview (action , fraction_or_amount , what )
126
128
else :
127
129
width = width or self ._canvas .winfo_width ()
128
130
@@ -133,15 +135,17 @@ def _xview(self, *args, width: int | None = None):
133
135
self ._canvas .xview_moveto ((1 - width / self ._frame .winfo_width ()) / 2 )
134
136
self ._peek_scrollbars ()
135
137
136
- def _yview (self , * args ):
138
+ def _yview (self , action : str , fraction_or_amount : float | int , what : str | None = None ):
137
139
"""
138
140
Called when a vertical scroll is requested. Scroll the viewport only if
139
141
it does not show everything in the vertical dimension.
140
142
141
- :param args: Passed to ``tkinter.Canvas.yview``.
143
+ :param action: First argument of ``tkinter.Canvas.yview``.
144
+ :param fraction_or_amount: Second argument of ``tkinter.Canvas.yview``.
145
+ :param what: Third argument of ``tkinter.Canvas.yview``.
142
146
"""
143
147
if self ._canvas .yview () != (0.0 , 1.0 ):
144
- self ._canvas .yview (* args )
148
+ self ._canvas .yview (action , fraction_or_amount , what )
145
149
self ._peek_scrollbars ()
146
150
147
151
def _configure_viewport_explicit (self , event : tk .Event ):
0 commit comments