hoffstadt / hoffstadt/DearPyGui

Disabled Button still appears clickable in UI

Open
#1,639 1 comment 3 reactions 0 assignees View on GitHub
priority: high type: improvement
Dominant language
C++
Stars
15.6k
Forks
783
PR merge metrics
No merged PRs in 30d

Description

## 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:
1. Create a button of a relatively large size
2. Set the button enabled to False
3. Run the program
4. Click the button
5. 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

```python
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()
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.