I'm trying to bind the endpoints of a line to the center of two buttons, however the line does not update as the buttons move. Here is my function that attempts to update the line:
def create_line(self): with self.canvas: l = Line(points = (self.pressedinputs[0].center + self.pressedoutputs[0].center), width = 3) c1 = self.pressedinputs[0].parent c2 = self.pressedoutputs[0].parent def update(l,*args): l.points = (self.pressedinputs[0].center + self.pressedoutputs[0].center) c1.bind(pos = update) c2.bind(pos = update)
The buttons are defined as self.pressedinputs[0] and self.pressedoutputs[0] and I was binding the update to the buttons' parents, which when moved will also move the button.
The function only makes a line at the current position of the buttons and do not update. How can I bind the lines?