hoffstadt / hoffstadt/DearPyGui

Node_editor - wrong widget callback

Open
#848 5 comments 1 reaction 0 assignees View on GitHub
category: node editor state: pending type: bug
Dominant language
C++
Stars
15.6k
Forks
783
PR merge metrics
No merged PRs in 30d

Description

## Version of Dear PyGui

Version: 0.6.415
Operating System: Mint 20.1 Cinnamon

## My Issue/Question

In node_editor, if 2 nodes with buttons are stacked on top of each other and the button is clicked, the callback on the bottom node is called instead of the callback of the visible top node.

## To Reproduce

Run the sample and click on 8 - 5 is printed. WRONG
Drag the node to different place and click on 8 again - 8 is printed.
Click on 5 - 5 is printed

## Expected behavior

Correct callback is executed.

## Screenshots/Video

![Screenshot from 2021-05-03 12-22-38](https://user-images.githubusercontent.com/34626170/116872583-077bb700-ac0e-11eb-9c6d-3cb7236bec10.png)
![Screenshot from 2021-05-03 12-23-47](https://user-images.githubusercontent.com/34626170/116872587-0c406b00-ac0e-11eb-8900-63f44f6a6f97.png)

## Standalone, minimal, complete and verifiable example

```python
import dearpygui.core as dc
import dearpygui.simple as ds

with ds.window('1'):
with ds.node_editor('2'):
with ds.node('3'):
with ds.node_attribute('4'):
dc.add_button('5', callback= lambda a, b :print('5'))
with ds.node('6'):
with ds.node_attribute('7'):
dc.add_button('8', callback= lambda a, b :print('8'))

dc.start_dearpygui(primary_window='1')
```

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.