Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nested Draw Layers raise an error #2371

Open
axeldavy opened this issue Aug 1, 2024 · 0 comments
Open

Nested Draw Layers raise an error #2371

axeldavy opened this issue Aug 1, 2024 · 0 comments
Labels
state: pending not addressed yet type: bug bug

Comments

@axeldavy
Copy link

axeldavy commented Aug 1, 2024

Version of Dear PyGui

Version: 1.11.1
Operating System: Arch Linux

My Issue/Question

I found out that using draw layers to quickly hide/show or delete lists of items gives a huge performance boost compared to doing it manually on each item.

As such I started making use of them a lot.

However I got an error when trying to create a draw layer inside a draw layer. I do not think there should be such a restriction.

To Reproduce

This code raises the following error:

import dearpygui.dearpygui as dpg

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

with dpg.window(tag="Primary Window"):
    with dpg.plot():
        with dpg.draw_layer():
            with dpg.draw_layer():
                print('Hello')

Exception: 
Error:     [1003]
Command:   add_draw_layer
Item:      24 
Label:     
Item Type: mvAppItemType::mvDrawLayer
Message:   Incompatible parent. Acceptable parents include:     mvAppItemType::mvTemplateRegistry
mvAppItemType::mvStage
mvAppItemType::mvDrawlist
mvAppItemType::mvWindowAppItem
mvAppItemType::mvPlot
mvAppItemType::mvViewportDrawlist

Expected behavior

Being able to use draw layers inside draw layers.

Simply adding draw layers as possible child/parent of draw layers inside the code works in my usecase, but there might be a bit more work in order to handle correctly the optional properties of draw layers.

@axeldavy axeldavy added state: pending not addressed yet type: bug bug labels Aug 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
state: pending not addressed yet type: bug bug
Projects
None yet
Development

No branches or pull requests

1 participant