aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuliette Monsel <j4321@users.noreply.github.com>2018-10-12 18:44:10 +0200
committerSerhiy Storchaka <storchaka@gmail.com>2018-10-12 19:44:10 +0300
commitbf034715db9d6e1603ea432d40041e5577ed3332 (patch)
tree1a0760703b4a32e3bee5f1d726ab51f48d864f68 /Lib/tkinter/__init__.py
parentbpo-34964: Make Tkinter sources more readable by adding blank lines. (GH-9822) (diff)
downloadcpython-bf034715db9d6e1603ea432d40041e5577ed3332.tar.gz
cpython-bf034715db9d6e1603ea432d40041e5577ed3332.tar.bz2
cpython-bf034715db9d6e1603ea432d40041e5577ed3332.zip
bpo-23831: Add moveto method to the tkinter.Canvas widget. (GH-9768)
Diffstat (limited to 'Lib/tkinter/__init__.py')
-rw-r--r--Lib/tkinter/__init__.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/Lib/tkinter/__init__.py b/Lib/tkinter/__init__.py
index fa015ff12e0..1dc41188451 100644
--- a/Lib/tkinter/__init__.py
+++ b/Lib/tkinter/__init__.py
@@ -2914,6 +2914,15 @@ class Canvas(Widget, XView, YView):
"""Move an item TAGORID given in ARGS."""
self.tk.call((self._w, 'move') + args)
+ def moveto(self, tagOrId, x='', y=''):
+ """Move the items given by TAGORID in the canvas coordinate
+ space so that the first coordinate pair of the bottommost
+ item with tag TAGORID is located at position (X,Y).
+ X and Y may be the empty string, in which case the
+ corresponding coordinate will be unchanged. All items matching
+ TAGORID remain in the same positions relative to each other."""
+ self.tk.call(self._w, 'moveto', tagOrId, x, y)
+
def postscript(self, cnf={}, **kw):
"""Print the contents of the canvas to a postscript
file. Valid options: colormap, colormode, file, fontmap,