Example #1
0
def get_item_children(item: int, slot: int = -1) -> Union[List[int], None]:
    """Provides access to the item's children slots.

    Returns:
        A 2-D tuple of children slots ex. ((child_slot_1),(child_slot_2),(child_slot_3),...) or a single slot if slot is used.
    """
    if slot < 0 or slot > 4:
        return internal_dpg.get_item_info(item)["children"]
    return internal_dpg.get_item_info(item)["children"][slot]
Example #2
0
def get_item_type(item: str) -> Union[str]:
    """Gets the item's type.

    Returns:
        type as a string or None
    """
    return internal_dpg.get_item_info(item)["type"]
Example #3
0
def get_item_children(item: str) -> Union[List[str], None]:
    """Gets the item's children.

    Returns:
        children as a list of string or None
    """
    return internal_dpg.get_item_info(item)["children"]
Example #4
0
def get_item_parent(item: str) -> Union[str, None]:
    """Gets the item's parent.

    Returns:
        parent as a string or None
    """
    return internal_dpg.get_item_info(item)["parent"]
Example #5
0
def is_item_container(item: str) -> Union[bool, None]:
    """Checks if item is a container.

    Returns:
        status as a bool
    """
    return internal_dpg.get_item_info(item)["container"]
Example #6
0
def get_item_disabled_theme(item: int) -> int:
    """Gets the item's disabled theme.

    Returns:
        theme's uuid
    """
    return internal_dpg.get_item_info(item)["disabled_theme"]
Example #7
0
def get_item_theme(item: int) -> int:
    """Gets the item's font.

    Returns:
        font's uuid
    """
    return internal_dpg.get_item_info(item)["font"]
Example #8
0
def get_item_parent(item: int) -> Union[int, None]:
    """Gets the item's parent.

    Returns:
        parent as a int or None
    """
    return internal_dpg.get_item_info(item)["parent"]
Example #9
0
def get_item_slot(item: int) -> Union[int, None]:
    """Returns an items target slot.

    Returns:
        slot as a int
    """
    return internal_dpg.get_item_info(item)["target"]
Example #10
0
def _config(sender, data):

    widget_type = dpg.get_item_info(sender)["type"]
    items = data
    value = dpg.get_value(sender)

    if widget_type == "mvAppItemType::mvCheckbox":
        keyword = dpg.get_item_configuration(sender)["label"]

    elif widget_type == "mvAppItemType::mvRadioButton":
        keyword = dpg.get_item_configuration(sender)["items"][value]

    if isinstance(data, list):
        for item in items:
            dpg.configure_item(item, **{keyword: value})
    else:
        dpg.configure_item(items, **{keyword: value})