简体   繁体   English

按下时,Python Tkinter按钮返回黑色

[英]Python tkinter button returns to black while pressed

I'm using Tkinter and I've noticed that my buttons become black while mouse button is held down irrespective of what color I have stated when declaring the button. 我使用的是Tkinter,我注意到按住鼠标按钮时我的按钮会变成黑色,无论我在声明按钮时是用什么颜色表示的。

Does anyone know if this can be controlled? 有谁知道这是否可以控制?

Kind regards,¨ 亲切的问候

Daniel 丹尼尔

You're looking for the activebackground and activeforeground properties. 您正在寻找activebackgroundactiveforeground属性。
Read more about them here . 在此处阅读有关它们的更多信息。

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

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