简体   繁体   English

如何阻止禁用的 tkinter 按钮变灰?

[英]How do I stop a disabled tkinter button from being greyed out?

Basically, I've got a tkinter button with an image on it, and when I disable the button it greys out a square around the image and looks pretty bad.基本上,我有一个带有图像的 tkinter 按钮,当我禁用该按钮时,它会使图像周围的正方形变灰,看起来很糟糕。 Is there any way to stop this from happening while keeping the button disabled?有没有办法在保持按钮禁用的同时阻止这种情况发生?

您可以取消绑定回调,而不是禁用按钮:

button['command']=0

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM