我试图在点击按钮时更新画布中的多边形并且它不起作用。
class UpdatePoly(Frame):
def __init__(self, master = None):
Frame.__init__(self, master, width=400, height=700)
self.grid(column=0, row=0, columnspan=3, rowspan=6,sticky=(N, S, E, W))
self.canvas = Canvas(self, width=400, height=600,background="#ffffff")
# self.canvas.configure(scrollregion=self.canvas.bbox("all"))
self.points = [0,0,0,2,2,4,7,9]
self.map_ = self.canvas.create_polygon(self.points)
self.canvas.grid(column=0, row=0, sticky="nsew")
def process(self):
# new co-ordinates
self.points = [3,4,6,9,4,5,9,0]
self.canvas.itemconfig(self.canvas.create_polygon(self.points))
我做错了什么?