Reputation: 73
I have a Tkinter Canvas with a lot of pictures on it, Is there any way to move them all easily? I know about 'canvas.move' but, its very repetitive and clustered when using it for many objects. Is there a way to move all objects on a canvas at the same time or, perhaps, combine all the pictures into a single object(using python)? Thanks in advance.
Upvotes: 1
Views: 2787
Reputation: 20679
You can pass the constant ALL
to the move method:
from Tkinter import *
root = Tk()
canvas = Canvas(root, width=200, height=200)
canvas.create_rectangle(10, 10, 60, 60)
canvas.create_rectangle(70, 70, 120, 120)
canvas.pack()
canvas.move(ALL, 50, 50)
root.mainloop()
Upvotes: 1