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.
- Draw moving object using Turtle in Python
- Python - Moving an object in PyGame
- PyQt5 QCalendarWidget - Moving it to the bottom of the parent stack
- PyQt5 QCalendarWidget - Moving it to the top of the parent stack
- MoviePy – Text with moving Letters
- PYGLET – Moving Caret to nearest point
- PyQtGraph – Moving Data of Scatter Plot Graph
- Place_forget() method using Tkinter in Python
- Color game using Tkinter in Python
- Python | Message Encode-Decode using Tkinter
- Python | Simple registration form using Tkinter
- Python | Simple GUI calculator using Tkinter
- Python | Distance-time GUI calculator using Tkinter
- Python | Random Password Generator using Tkinter
- Python | Real time currency convertor using Tkinter
- Python | Real time weather detection using Tkinter
- Python | Simple FLAMES game using Tkinter
- Python | Simple calculator using Tkinter
- Python | Create a digital clock using Tkinter
- Python | Loan calculator using Tkinter
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.