tkinter单选按钮文本换行

时间:2018-06-21 21:38:03

标签: python python-3.x tkinter

我正在使用Tkinter创建一个单选按钮,如下所示:

rad1 = Radiobutton(bottomFrame, wraplength = 500, text= 'abc', value='A', variable=selected, command = lambda : clicked())

并出现以下换行长度错误:

  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/tkinter/ttk.py", line 1054, in __init__
    Widget.__init__(self, master, "ttk::radiobutton", kw)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/tkinter/ttk.py", line 559, in __init__
    tkinter.Widget.__init__(self, master, widgetname, kw=kw)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/tkinter/__init__.py", line 2296, in __init__
    (widgetName, self._w) + extra + self._options(cnf))
_tkinter.TclError: unknown option "-wraplength"

1 个答案:

答案 0 :(得分:-1)

也许这取决于您的python版本。

  

尝试将 wraplenght 替换为 wrap