hoffstadt / DearPyGui

Dear PyGui: A fast and powerful Graphical User Interface Toolkit for Python with minimal dependencies
https://dearpygui.readthedocs.io/en
MIT License
12.96k stars 677 forks source link

Deleting a popup does not delete its item handler registry #1969

Open Creonalia opened 1 year ago

Creonalia commented 1 year ago

Version of Dear PyGui

Version: 1.8.0 Operating System: Windows 10

My Issue/Question

Deleting a popup does not delete its item handler registry.

To Reproduce

Steps to reproduce the behavior:

  1. Create a popup
  2. Delete popup
  3. Open the Item Registry window and expand Item Handler Registries
  4. Popup's item handler registry will be shown

Expected behavior

The item handler should be deleted when the popup is deleted.

Screenshots/Video

image

Standalone, minimal, complete and verifiable example

import dearpygui.dearpygui as dpg

dpg.create_context()

with dpg.window(tag="window"):
    group = dpg.add_group()
    with dpg.popup(group, tag="popup") as popup:
        pass

dpg.delete_item(popup)

dpg.create_viewport()
dpg.setup_dearpygui()
dpg.show_viewport()

dpg.show_item_registry()

dpg.start_dearpygui()
dpg.destroy_context()
Kazimir4 commented 1 year ago

def handle_menu(sender): main_page = [24] res = [x for x in main_page + dpg.get_windows() if x not in main_page or x not in dpg.get_windows()] for i in res: dpg.delete_item(i)