Open tnsolley opened 5 years ago
Looking at the docs, the tkinter button doesn't support disabledbackground
: http://effbot.org/tkinterbook/button.htm
So I don't think this is possible, you could try changing the background colour when you enable/disable buttons see if that works?
If it does, we could look at adding that in as a feature - when someone sets a disabled bg colour on a button, we can store it, then use it as a bg colour when the button is disabled...
@jarvisteach
Yes, this works (though gets cumbersome with extensive usage).
Essentially every app.enableButton(name)
must be accompanied-with a app.setButtonBg(name, enableBg)
call (to "reset" the color), and every app.disableButton(name)
with its own app.setButtonBg(disableBg)
call (to set the button disabled).
At the moment I'm using the appjar.py
values for Disabled and Active Tabs (Fg, Bg) as the appropriate enableBg
and disableBg
colors, that is
disBg = "darkGray"
disFg = "gray"
enaBg = "#F6F6F6"
enaFg = "#000000" # For posterity
If a user changes the Tab-colors, I'd suggest the Buttons inherit those values as default, unless override is given... or maybe add a second & third parameter to app.enableButton()
and app.disableButton()
which lets the users explicitly enter their own overrides for Bg and Fg?
Now have the disabledBg being stored in the button and applied when the button is disabled, with the original bg being applied when the button is enabled.
Need to do testing on other platforms & check other states.
Bug Report
Context
Attempting to make Enabled and Disabled buttons more visually distinct than the default (which is a Fg change only)
Expected Behaviour
All Button items listed, on Disable, will be a different color than the default, with no errors or warnings.
Actual Behaviour
AppJar throws WARNINGs for each and every
app.setButtonDisabledBg()
call, and not for theapp.setButtonDisabledFg()
call.Any error messages produced by appJar
Terminal output as below:
Sample code, demonstrating the issue
What steps are needed to reproduce the bug
Add
app.setButtonDisabledBg()
method to any button.Version Information
Windows 10 SP1, Python 3.7.2, appJar 0.9.3