hoffstadt/DearPyGui

Callbacks Not Triggering for Node Manipulations in Node Editor

gaviral opened this issue · 0 comments

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

Standalone, Minimal, Complete and Verifiable Example

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.