hoffstadt / hoffstadt/DearPyGui
get_item_parent does return tag instad of ID
- Dominant language
- C++
- Stars
- 15.6k
- Forks
- 783
- PR merge metrics
- No merged PRs in 30d
Description
### Dear PyGui version:
3.0.0
### Python version:
3.11.9
### Operating system:
Windows 11
### My issue/question:
get_item_parent returns the parents tag (if there is one) instead of the parents ID as it is stated in the documentation. Either the documentation should be updated to reflect this API change or the method should be fixed to return the parents ID.
### Steps to reproduce:
See minimal example below.
### Expected behavior:
As per [documentation](https://dearpygui.readthedocs.io/en/latest/reference/dearpygui.html?highlight=get_item_parent#dearpygui.dearpygui.get_item_parent) get_item_parent should return the parents ID as int or None.
### Screenshots:
N/A
### Standalone, minimal, complete and verifiable example:
```python
import dearpygui.dearpygui as dpg
dpg.create_context()
dpg.create_viewport()
dpg.setup_dearpygui()
with dpg.window(tag="minimal", label="minimal"):
dpg.add_text("Hello world", tag="text")
dpg.show_viewport()
assert isinstance(x := dpg.get_item_parent("text"), int), f"get_item_parent returned {type(x)} instead of {int}"
dpg.start_dearpygui()
dpg.destroy_context()
```
Contributor guide
Research direction
Start by running the minimal Python example against Dear PyGui 3.0.0 and inspect the implementation or documentation for get_item_parent. Determine whether the intended result is the parent ID or tag, then make the behavior and documentation agree and verify the reported assertion.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, python
- Domain
- desktop-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 58/100