2015-06-21 72 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

相關問題