我正在尝试使用 RadioButton 制作一个基本的绘图程序来确定画笔的形状。
self.choseo = Radiobutton(text='Circle', variable=shape,indicatoron=0, value=1)
self.choser = Radiobutton(text='Rectangle', variable=shape,indicatoron=0, value=2)
self.chosea = Radiobutton(text='Arc', variable=shape,indicatoron=0, value=3)
对应于:
if shape.get()==3:
self.display.create_arc( self.x1, self.y1, self.x2,
self.y2, fill = mycolor, outline= mycolor, tags = "line")
elif shape.get()==2:
self.display.create_rectangle( self.x1, self.y1, self.x2,
self.y2, fill = mycolor, outline= mycolor, tags = "line")
elif shape.get()==1:
self.display.create_oval( self.x1, self.y1, self.x2,
self.y2, fill = mycolor, outline= mycolor, tags = "line")
当我运行这个我得到这个错误:
"TypeError: get() takes exactly 1 argument (0 given)"
我如何使这项工作?