hoffstadt / hoffstadt/DearPyGui
Open another modal window from a modal window
- Dominant language
- C++
- Stars
- 15.6k
- Forks
- 783
- PR merge metrics
- No merged PRs in 30d
Description
**Is your feature request related to a problem? Please describe.**
When I try to open another window in a modal window, for example, pop up a message box, I cannot get what I want. When the second window is also modal, it will not appear. When the second window is a non-modal window, it will automatically close the first window.
**Describe the solution you'd like**
It'd be great if another modal window can be opened from a modal window.
**Describe alternatives you've considered**
Set the second window to modal=False, and when the second window is closed, redisplay the first window (by setting show=True). This is trivial for a simple pop-up message box.
**Additional context**
Here is a simple example
```python
import dearpygui.dearpygui as dpg
dpg.create_context()
def open_modal(s, a, u):
with dpg.window(label='2nd window', modal=True) as modal2:
dpg.add_text('this is the second modal window')
dpg.add_button(
label='Ok', callback=lambda: dpg.configure_item(modal2, show=False))
dpg.create_viewport(title='hello')
with dpg.window(label='1st window', modal=True) :
dpg.add_text("this is the first modal window")
dpg.add_button(label='open 2nd modal window', callback=open_modal)
dpg.setup_dearpygui()
dpg.show_viewport()
dpg.start_dearpygui()
dpg.destroy_context()
```
Contributor guide
Assessment
This issue has not been assessed yet.