Skip to content

get_item_parent does return tag instad of ID #2661

Description

@simonblum-db

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 get_item_parent should return the parents ID as int or None.

Screenshots:

N/A

Standalone, minimal, complete and verifiable example:

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()

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions