hoffstadt / hoffstadt/DearPyGui

Showing Popups from Within Other Popups

Open
#2,183 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

Windows 10/11
DearPyGui v1.9.1, v1.10.0

Nesting popups is seemingly impossible outside of using `mvMenu` items. I've tried many mixtures of handlers and arguments and I cannot get `nested_popup` to display without closing the other popups. When `no_open_over_existing_popup=True`, of course the nested popup won't display. When False, the nested popup displays but closes it's "parent".

```python
from dearpygui import dearpygui

dearpygui.create_context()
dearpygui.setup_dearpygui()
dearpygui.create_viewport()

with dearpygui.window(popup=True, show=False) as popup:
button1 = dearpygui.add_button(width=-1)

# throw initial popup on click
with dearpygui.handler_registry() as hr:
dearpygui.add_mouse_click_handler(
-1,
callback=lambda: dearpygui.show_item(popup)
)

with dearpygui.window(popup=True, show=False, no_open_over_existing_popup=False) as nested_popup:
button2 = dearpygui.add_button(width=-1)

with dearpygui.item_handler_registry() as ihr_show_npopup:
dearpygui.add_item_hover_handler(
callback=lambda: dearpygui.show_item(nested_popup)
)

# throw nested popup on button hover
dearpygui.bind_item_handler_registry(
button1,
ihr_show_npopup
)

dearpygui.show_viewport()
dearpygui.start_dearpygui()
```

I've tagged this as a bug, but this is probably the expected behavior. If that's the case though, I don't understand the intended usage for `no_open_over_existing_popup`.

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.