tkinter color of disabled buttons / disabled optionmenus

时光怂恿深爱的人放手 提交于 2019-12-01 08:07:32

问题


I am working on a quicklist editor for Unity (Ubuntu). The (initial) interface contains both disabled optionmenu buttons (right down, the "+", and the edit button, upper right) and disabled "normal" buttons. tkinter however does not treat both kinds of disabled icons equally; the disabled optionmenu icons are somewhat darker than the "normal" disabled button icons. Is there a solution for this, other than a complicated workaround, replacing the icons with just images, on disable-events?


回答1:


....It turns out there is no other solution than, instead of using the DISABLED state, replacing the button with another image with no button functionality at all, for as long as the button is meant to be disabled. Although it takes a few lines of extra coding, it also gives you the benefit of control on how the disabled button looks. At the same time, I think it is kind of a bug that disabled option buttons are of slightly different color than other disabled buttons.



来源:https://stackoverflow.com/questions/11366349/tkinter-color-of-disabled-buttons-disabled-optionmenus

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!