Skip to content

hkb_editor.gui.widgets.bindable_attribute

bindable_attribute

bindable_attribute(
    filter_key: str = "", tag: str = 0, **kwargs
) -> Generator[str, None, None]

Wrap an attribute widget so it can be swapped for a variable binding.

Yields the tag the binder is referred to by. Widgets created inside the context land in the "unbound" group, which is hidden and replaced by the variable name once the attribute is bound.

select_variable_to_bind

select_variable_to_bind(
    behavior: HavokBehavior,
    record: HkbRecord,
    bindable_attribute: str,
    path: str,
    on_bind: Callable[
        [str, tuple[int, str], Any], None
    ] = None,
    user_data: Any = None,
) -> None

Open the variable picker and bind the chosen variable to path.

Clearing the selection removes the binding instead. on_bind receives [variable_index, binding_set], or None when the binding was cleared.

set_bindable_attribute_state

set_bindable_attribute_state(
    behavior: HavokBehavior,
    bindable_attribute: str,
    bound_var_idx: int = -1,
) -> None

Show either the bound variable name or the attribute's own widgets.

Ko-fi donations