问题描述
我已经使用 Tkinter 几个星期了.我注意到的一件事是 tkinter 小部件(按钮等)有 3 个状态:NORMAL
、ACTIVE
和 DISABLED
.我了解 NORMAL
和 DISABLED
状态.ACTIVE
和 NORMAL
状态之间有什么区别?
I have been using Tkinter from couple of weeks. One thing I have noticed is that the tkinter widgets (Button, etc.) have 3 states: NORMAL
, ACTIVE
and DISABLED
. I understand the NORMAL
and DISABLED
states. Whats the difference between the ACTIVE
and NORMAL
states?
推荐答案
当鼠标悬停在非禁用按钮选项(即 NORMAL)上时,Tk 设置 state = ACTIVE 然后它可以显示为凸起、凹陷、平坦、flash 等.所以基本上,NORMAL 在 ACTIVE 时启用一个按钮可以更改鼠标悬停等的外观设置.希望这会有所帮助,这里有一篇很棒的帖子:
Tk sets state = ACTIVE when a mouse is over a non-DISABLED button option (i.e. NORMAL) It can then be made to appear raised, sunken, flat, flash etc. So basically, NORMAL enables a button while ACTIVEcan change the appearance settings on mouse over etc. Hope this helps, there's a great post about it here:
http://tkinter.unpythonic.net/wiki/Widgets/Button
这篇关于ACTIVE 和 NORMAL 状态的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!