Canvas class of Tkinter supports a functions which is used to move objects from one position to another in any canvas or tkinter toplevel.
Syntax: Canvas.move(canvas_object, x, y)
canvas_object is any valid image or drawing created with the help of Canvas class. To know how to create object using Canvas class take reference of this.
x is horizontal distance from upper-left corner.
y is vertical distance from upper-left corner.
We will use class to see the working of
Data members used:
Member functions used:
Widgets used: Canvas
Tkinter method used:
Below is the Python implementation:
Extra print statements are used in above code to show the proper working of move() method. keysym keyword (Tkinter reserved) is used to print which keyboard key is pressed.
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course. And to begin with your Machine Learning Journey, join the Machine Learning – Basic Level Course