hoffstadt / hoffstadt/DearPyGui

Callbacks Not Triggering for Node Manipulations in Node Editor

Open
#2,328 0 comments 0 reactions 0 assignees View on GitHub
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:** 1.11.1
**Operating System:** macOS Sonoma 14.4.1 (Darwin Kernel Version 23.4.0)

## My Issue/Question

The `drag_callback` and `drop_callback` functions in the node editor are not producing the expected console output when nodes are manipulated. Despite setting up straightforward callback functions to log messages, no feedback appears in the console when nodes are dragged or dropped.

## To Reproduce

Steps to reproduce the behavior:
1. Initialize Dear PyGui with the provided code snippet.
2. In a window, set up a node editor and add a node with both `drag_callback` and `drop_callback` functions.
3. Launch the application and interact with the node by dragging and dropping it within the editor.
4. Observe the lack of expected console messages detailing the actions, indicating that the callbacks are not being triggered.

## Expected Behavior

Upon dragging or dropping a node within the node editor, the console should display messages such as 'Node [node ID] dragged' and 'Node [node ID] dropped'. This feedback is essential for verifying that the node interactions are being handled correctly.

## Screenshots/Video

For a visual representation of the issue, refer to the linked video:
![Bug Report GIF](https://github.com/hoffstadt/DearPyGui/assets/12901566/60057c3b-5ea5-4110-b752-e86cf9740c1a)

## Standalone, Minimal, Complete and Verifiable Example

```python
import dearpygui.dearpygui as dpg

dpg.create_context()
dpg.create_viewport()
dpg.setup_dearpygui()

with dpg.window(label="Node Editor Example"):
with dpg.node_editor():
node = dpg.add_node(label="Sample Node", drag_callback=lambda s, a, u: print(f"Node {s} dragged"), drop_callback=lambda s, a, u: print(f"Node {s} dropped"))

print("TESTING!!") # This print statement should appear immediately on running.

dpg.show_viewport()
dpg.start_dearpygui()
dpg.destroy_context()
```

This code demonstrates a lack of feedback from the `drag_callback` and `drop_callback` during node interactions within the node editor.

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.