我想创建一个Listbox对象的类,这样它就可以在任何需要它的地方使用,但它抛出了TypeError错误,以下是我的代码: import tkinter as tk
File "/usr/lib/python3.9/tkinter/__init__.py", line 3162, in __init__init__(
我一直在尝试使用这个答案中提供的代码: Terminate the Thread by using button in Tkinter 但每次我运行它时,当我单击按钮时,我都会得到以下错误消息: self.stop_threads.clear()事件:“AttributeError”对象没有“”clear“”属性“” self.stop_threads.set() AttributeError:“”Event“”对象没有属性“”set“”from threading import Thr
在Tkinter中,我创建了函数setstatus:它将输入字符串附加到状态消息列表中,并在列表框中显示消息列表:root.geometry("487x680")do_plot() # creates a plot from matplotlibroot.mainloop()
当在调试模式下运行它时,它工作正常,所有状态消息都会出现在列表框中。在状态消息<e
我正在尝试使用带有tkinter字体的列表框来更改文本字段的字体。除了第一次选择列表框外,它工作得很好。在第一次单击列表框时,我会得到这个错误消息IndexError: tuple index out of range,带有列表框选择的元组将是()。然而,下一个选择将完全正常。如果我为<Double-Button-1>绑定<Button-1>,那么第一个选择(双击列表框)可以正常工作。= tkinter.Tk(