I am unable to bind the mouse movement to the line drawn. I currently have a button which draws lines when clicked, but the problem is i want to move these lines using the mouse ,but i keep getting error.
from tkinter import *
root = Tk()
root.title('Column-seperator')
root.geometry('800x600')
canvas = Canvas(root,width = 480,height = 600)
canvas.pack(padx=5,pady=5)
line = canvas.create_line(300, 35, 300, 200, dash=(4, 2))
btn1 = Button(root, text = 'line', bd = '5',command = line)
btn2 = Button(root, text = 'Close', bd = '5',command = root.destroy)
btn1.pack(side = 'top')
btn2.pack(side = 'top')
root.bind("<B1-Motion>", line)
root.mainloop()
And ultimately return the x-coordinates of all these lines.