Python Tkinter收音机按钮指示灯未识别
我希望我的单选按钮通过设置indicatoron=0来使用本页所述的按钮盒界面: 代码段:Python Tkinter收音机按钮指示灯未识别,python,python-2.7,tkinter,Python,Python 2.7,Tkinter,我希望我的单选按钮通过设置indicatoron=0来使用本页所述的按钮盒界面: 代码段: import ttk ... self.selectedSectionCode = StringVar() self.selectedSectionCode.set("abc") abcButton = ttk.Radiobutton(self, text='ABC', variable=self.selectedSectionCode, value='abc', in
import ttk
...
self.selectedSectionCode = StringVar()
self.selectedSectionCode.set("abc")
abcButton = ttk.Radiobutton(self, text='ABC', variable=self.selectedSectionCode, value='abc', indicatoron= 0)
abcButton.grid(column=0, row=1, sticky=(N,W))
但是,当我运行代码时,会出现以下错误:
File "C:\Users\...\view.py", line 473, in __init__
abcButton = ttk.Radiobutton(self, text='ABC', value='abc', indicatoron = 0)
File "C:\Python27\lib\lib-tk\ttk.py", line 1073, in __init__
Widget.__init__(self, master, "ttk::radiobutton", kw)
File "C:\Python27\lib\lib-tk\ttk.py", line 560, in __init__
Tkinter.Widget.__init__(self, master, widgetname, kw=kw)
File "C:\Python27\lib\lib-tk\Tkinter.py", line 1974, in __init__
(widgetName, self._w) + extra + self._options(cnf))
clError: unknown option "-indicatoron"
我不知道为什么这不起作用,在这个网站上有几个例子提到了Radiobutton小部件使用的这个选项,用户也在使用Python2.7
我的代码中缺少什么吗?您链接的文档是针对
Tkinter.Radiobutton
类的。您正在使用的类不支持指示符
属性