Skip to content

Exposing Item Type Information in Python#2608

Open
Atlamillias wants to merge 6 commits intohoffstadt:masterfrom
Atlamillias:master
Open

Exposing Item Type Information in Python#2608
Atlamillias wants to merge 6 commits intohoffstadt:masterfrom
Atlamillias:master

Conversation

@Atlamillias
Copy link
Contributor

@Atlamillias Atlamillias commented Feb 22, 2026

Description:
This PR adds a few new functions in dearpygui.dearpygui that expose system-level item type information that only exists in C++ source code, documentation context, or at runtime via DearPyGui error messages. This information is very useful for generating documentation, writing unit tests, and to anyone building on top of the library (wrappers, custom widgets, etc).

New Functions:

  • get_item_type_parents(): Returns the result of DearPyGui::GetAllowableParents() for all item types as dict[str, dict[str, int]]. Strings in the outer dictionary are qualified item type names, where the inner dictionaries contain the type information (as type name to enum value pairs) of items that can parent items of that type.
  • get_item_type_children(): Similar to get_item_type_parents(), but returns child type information instead using DearPyGui::GetAllowableChildren().
  • get_item_type_states(): Returns a mapping of qualified item type names and tuples containing applicable/supported states.
  • get_item_type_commands(): Returns a mapping of qualified item type names and names of their associated item command in dearpygui.dearpygui.
  • is_item_type_container(*item_type*): Returns True if item_type has the MV_ITEM_DESC_CONTAINER flag, and False otherwise.
  • is_item_type_root_container(*item_type*): Returns True if item_type has the MV_ITEM_DESC_ROOT flag, and False otherwise.

Concerning Areas:
The functions added in this PR only expose information from already-existing structures, and does not affect existing code nor does it implement any new systems or structures. The only function that may require maintenance is get_item_type_states(), when new states are implemented (like those added in 2.2 related to scrolling).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant