2015-06-21 68 views
1

我一直在试图创建一个简单的RadioButton,但问题是这两个按钮已经显示为单击(GUI启动时它们内部有黑色圆圈)。我将如何解决这个问题?如何在我的GUI中使用python创建一个RadioButton?

this.myVar = StringVar() 
this.button1 = Radiobutton(this.root,text = "Small Boxes First",variable = this.myVar) 
this.button1.grid(row = 2,column = 5) 
this.button2 = Radiobutton(this.root,text = "Large Boxes First",variable = this.myVar) 
this.button2.grid(row = 3,column = 5) 

回答

1

使用SetValue(self, False)将其设置为未选中状态。 您可以阅读更多关于它here

相关问题