DearPyGui icon indicating copy to clipboard operation
DearPyGui copied to clipboard

Node_editor - wrong widget callback

Open m-holger opened this issue 4 years ago • 4 comments

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 Screenshot from 2021-05-03 12-23-47

Standalone, minimal, complete and verifiable example

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')

m-holger avatar May 03 '21 12:05 m-holger

@hoffstadt I can confirm this! It seems that the bounding boxes for the items inside the nodes are stacked from top to bottom, starting with the node that was created first. The draw order is dependent on which node was active last, but the bounding box order is not influenced by this.

iFreilicht avatar May 18 '21 21:05 iFreilicht

This appears to be related to this. Will fix when he resolves the issue in imnodes.

hoffstadt avatar Jul 07 '21 03:07 hoffstadt

Is this still an issue in 0.8?

hoffstadt avatar Oct 01 '21 20:10 hoffstadt

Is this still an issue in 0.8?

@hoffstadt It is still an issue in 1.9.1 This is actually pretty severe. Unbenannt1

Slluxx avatar Aug 15 '23 00:08 Slluxx