Tkinter Widget Cursors Property
Cursors represent cursor shapes. You can use this function if you want to change the shape of the cursor during programming, for example, you can design the shape of the mouse cursor when it is on a Label or Button. However, readers should note that the cursor shape may vary depending on the operating system. Below is the correspondence between cursor shape and name.
Some widget controls have cursor as a parameter, from which you can set the shape of the cursor when it is on the control, if omitted, the system will follow the shape of the cursor on the parent container.
Tkinter Widget Cursors Property Example
When the mouse cursor passes over the raised label, its shape will change to "heart". The focus of this program is on line 11.
"""
Tkinter cursor example
"""
from tkinter import *
root = Tk()
root.title("apidemos.com")
label = Label(root,text="raised",relief="raised",
# bg="lightyellow",padx=5,pady=10,cursor="spider")
bg="lightyellow",padx=5,pady=10,cursor="heart")
label.pack()
root.mainloop()
Output: