一般来说,我对tkinter和python都是新手。我正在申请,需要一个“设置”按钮。
我就是这样创建它的:
buttonSettings = Button(win, text=txtSettings, command=lambda: create_window(win))
buttonSettings.grid(row=1, column=4)
其中:
def create_window(win):
window = Toplevel(win)
如何将该按钮可以创建的窗口数限制为一个
Tags:
尝试此操作您将需要添加
window = None
来初始化您的对象如果您的目标是能够打开特定数量的窗口,那么考虑将这些窗口存储在列表中,然后使用^ {CD1>},您可以从存在的列表中弹出它们。
请参阅下面的示例,如果您有问题,请告诉我:
相关问题 更多 >
编程相关推荐