DearPyGui icon indicating copy to clipboard operation
DearPyGui copied to clipboard

Showing Popups from Within Other Popups

Open Atlamillias opened this issue 2 years ago • 0 comments

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".

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.

Atlamillias avatar Sep 18 '23 05:09 Atlamillias