hoffstadt / hoffstadt/DearPyGui
`get_windows()` returns all root items
- Dominant language
- C++
- Stars
- 15.6k
- Forks
- 783
- PR merge metrics
- No merged PRs in 30d
Description
Windows 10
Python v3.14.3
DearPyGui v2.2.0
```python
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:
```python
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.
Contributor guide
Assessment
This issue has not been assessed yet.