Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e931ed5

Browse files
committed
Fix SF bug # 602259, 3rd parameter for Tkinter.scan_dragto
Add the optional gain parameter and pass it to Tk.
1 parent faa7b9b commit e931ed5

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

Lib/lib-tk/Tkinter.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2139,11 +2139,11 @@ def scale(self, *args):
21392139
def scan_mark(self, x, y):
21402140
"""Remember the current X, Y coordinates."""
21412141
self.tk.call(self._w, 'scan', 'mark', x, y)
2142-
def scan_dragto(self, x, y):
2143-
"""Adjust the view of the canvas to 10 times the
2142+
def scan_dragto(self, x, y, gain=10):
2143+
"""Adjust the view of the canvas to GAIN times the
21442144
difference between X and Y and the coordinates given in
21452145
scan_mark."""
2146-
self.tk.call(self._w, 'scan', 'dragto', x, y)
2146+
self.tk.call(self._w, 'scan', 'dragto', x, y, gain)
21472147
def select_adjust(self, tagOrId, index):
21482148
"""Adjust the end of the selection near the cursor of an item TAGORID to index."""
21492149
self.tk.call(self._w, 'select', 'adjust', tagOrId, index)

Misc/NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,9 @@ Library
8888

8989
- urlparse can now parse imap:// URLs. See SF feature request #618024.
9090

91+
- Tkinter.Canvas.scan_dragto() provides an optional parameter to support
92+
the gain value which is passed to Tk. SF bug# 602259.
93+
9194
Tools/Demos
9295
-----------
9396

0 commit comments

Comments
 (0)