-->

tkinter color of disabled buttons / disabled optio

2019-02-19 20:13发布

问题:

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.