Windows 10
Python v3.14.3
DearPyGui v2.2.0
import dearpygui.dearpygui as dpg
dpg.create_context()
dpg.setup_dearpygui()
dpg.add_window()
dpg.add_theme()
dpg.add_handler_registry()
dpg.add_item_handler_registry()
assert len(dpg.get_windows()) != 4, "too many items"
The issue with fixing this is that it's nice to have a performant option to get all top-level items. It's also behaved like this for...awhile, so maybe it's best to not fix it (although documenting it might be helpful).
Maybe we could make a new function, instead? Something like:
def get_existing_items(item_types: Sequence[int] | None = None) -> list[int]: ...
...where all items are returned when item_types == None (the current behavior of get_windows()) . Otherwise, only return items of types contained in item_types. Whether we fix it or create a new function, I can work on a PR for it.
Windows 10
Python v3.14.3
DearPyGui v2.2.0
The issue with fixing this is that it's nice to have a performant option to get all top-level items. It's also behaved like this for...awhile, so maybe it's best to not fix it (although documenting it might be helpful).
Maybe we could make a new function, instead? Something like:
...where all items are returned when
item_types == None(the current behavior ofget_windows()) . Otherwise, only return items of types contained initem_types. Whether we fix it or create a new function, I can work on a PR for it.