python - 单击其中一个按钮后如何禁用 3 个按钮?
问题描述
以下是输出中的按钮:
这里是代码中的相同按钮,我想在单击其中一个按钮后禁用它们:
这是完整的代码:
root = Tk()
root.title("Menu du jeu")
root.geometry("600x300")
root.config(bg="#7f7f7f")
b1 = Button(root, text="Facile", fg='white', bg="black", command=lambda: [commencerJeu1(), root.destroy()])
b1.pack(side="left", ipadx=10, ipady=10)
b2 = Button(root, text="Moyen", fg='blue', bg="black", command=lambda: [commencerJeu2(), root.destroy()])
b2.pack(side="left", ipadx=10, ipady=10)
b3 = Button(root, text="Difficile", fg='orange', bg="black", command=lambda: [commencerJeu3(), root.destroy()])
b3.pack(side="left", ipadx=10, ipady=10)
b4 = Button(root, text="fermer", fg='yellow', bg="black", command=root.destroy)
b4.pack(side="right", ipadx=10, ipady=10)
root.mainloop()
解决方案
推荐阅读
- php - Cron 作业在其他控制器 CodeIgniter 中不起作用
- character - “错误:无法转换
性格” - arrays - C指针,了解如何将数组传递给函数
- nginx - 服务器没有响应客户端的 ping
- reactjs - 如何使用 React js 通过 OIDC 实现 SSO 登录
- css - 区分移动端和桌面端
- file - Prestashop“找不到文件问题”
- javascript - 有什么作用!JS中的句尾是什么意思?
- java - 如何在 Spring 拦截器中使用异步服务?
- c# - 何时应该使用 Pipes 或 gRPC 进行进程间通信(在 C# .NET Core 中)?