I have been trying to change the cursor in Tkinter. This is my code:
# explore_Tkinter.py
from Tkinter import *
def callback1(event):
print "one clicked at", event.x, event.y
def callback2(event):
print "two clicked at", event.x, event.y
root = Tk()
img = PhotoImage(file = "image002.gif")
canvas = Canvas(root, width = 1000, height = 700, cursor = "crosshair")
s1 = canvas.cget('cursor')
print "s1 ", s1
canvas.pack()
canvas.create_image(100, 200, image = img, anchor = 'nw')
canvas.bind("<Button-1>", callback1)
canvas.bind("<Button-2>", callback2)
mainloop()
When I run this the program prints
s1 crosshair
indicating that the cursor has been changed but the actual cursor on the image remains the same (an 'arrow').
What am doing wrong or not doing?