我试图在以下方法中使用tkinter.button:
def _draw(self, canvas, options):
p = self.anchor
x,y = canvas.toScreen(p.x,p.y)
frm = tk.Frame(canvas.master)
frm.pack_propagate(0)
frm.pack()
self.button = tk.Button(frm,
height = self.height,
width = self.width,
text = self.label,
bg = self.fill,
fg = self.color,
font=self.font)
self.button.place(self.x, self.y, self.height, self.width)
#self.setFill(self.fill)
self.button.focus_set()
return canvas.create_window(x,y,window=frm)
我目前收到以下错误:
File "/Users/tmcdo13/.local/lib/python3.6/site-packages/graphics.py", line 913, in _draw
self.button.place(self.x, self.y, self.height, self.width)
TypeError: place_configure() takes from 1 to 2 positional arguments but 5 were given
这让我感到困惑,因为我使用的是button.place,而不是button.place_configure。有什么想法吗?