Disabled Button still appears clickable in UI
Version of Dear PyGui
Version: 1.4.0 Operating System: Windows 10
My Issue/Question
When a button is set to enabled=False, it still appears to be clickable because the button color changes when a user clicks on it. In previous versions, the entire button was greyed out and clicking it had no effect if it was not enabled.
I tested this in 0.6.415 and the button is grey and doesn't respond to clicks.
To Reproduce
Steps to reproduce the behavior:
- Create a button of a relatively large size
- Set the button enabled to False
- Run the program
- Click the button
- Notice that the buttons' background color changes when clicked despite the fact that it is not enabled.
Expected behavior
The button should be greyed out and not react to clicks when it is disabled. Instead, it behaves exactly the same way as an enabled button from a UI perspective.
Standalone, minimal, complete and verifiable example
import dearpygui.dearpygui as dpg
dpg.create_context()
dpg.create_viewport(title='Button Test', width=600, height=300)
def test_func():
print("Testing Button")
with dpg.window(label="button"):
dpg.add_button(label="Test Button", callback=test_func, enabled=False, width=400, height=40)
dpg.setup_dearpygui()
dpg.show_viewport()
dpg.start_dearpygui()
dpg.destroy_context()
You are correct. At the moment, you have to create a "disabled theme" since we don't have a default one. We will be adding it back though shortly.