selection
6 functions / 0 types
Index
| Function | Description |
|---|---|
| clear | Clear all nodes from the selection. |
| pop_node | Pop the most recently selected node from the selection (the same node last_selected reads). |
| push_node | Push a node onto the selection, starting a new selection if none exists. |
| read | Read the current selection, returning the non-empty selected nodes in slot order. |
| set_selection | Replace the entire selection with a new ordered list of nodes. |
| set_slot | Set a specific selection slot by index. |
clear
def clear(*, _transaction_id: str | None = None) -> NoneClear all nodes from the selection.
Returns None.
_transaction_id optional : str | None
Transaction to join. Omit to submit without an explicit transaction. Defaults to None.
pop_node
def pop_node(
*,
_transaction_id: str | None = None
) -> types.project.object.ProjectNode | NonePop the most recently selected node from the selection (the same node last_selected reads).
Returns ProjectNode | None.
_transaction_id optional : str | None
Transaction to join. Omit to submit without an explicit transaction. Defaults to None.
push_node
def push_node(
*,
node: types.project.object.ProjectNode,
_transaction_id: str | None = None
) -> NonePush a node onto the selection, starting a new selection if none exists.
Returns None.
node : ProjectNode
The node to push.
_transaction_id optional : str | None
Transaction to join. Omit to submit without an explicit transaction. Defaults to None.
read
def read(
*,
_transaction_id: str | None = None
) -> tuple[types.project.object.ProjectNode, ...]Read the current selection, returning the non-empty selected nodes in slot order.
Returns tuple[ProjectNode, ...].
_transaction_id optional : str | None
Transaction to join. Omit to submit without an explicit transaction. Defaults to None.
set_selection
def set_selection(
*,
nodes: list[types.project.object.ProjectNode] | None = None,
_transaction_id: str | None = None
) -> NoneReplace the entire selection with a new ordered list of nodes.
Returns None.
nodes optional : list[ProjectNode] | None
The nodes to select, in slot order. Defaults to None.
_transaction_id optional : str | None
Transaction to join. Omit to submit without an explicit transaction. Defaults to None.
set_slot
def set_slot(
*,
index: int,
node: types.project.object.ProjectNode | None = None,
_transaction_id: str | None = None
) -> NoneSet a specific selection slot by index.
A node fills the slot, and an absent node clears it. The selection grows with empty slots when
index is beyond its current length.
Returns None.
index : int
Slot index to set.
node optional : ProjectNode | None
The node to place in the slot. An absent node clears the slot. Defaults to None.
_transaction_id optional : str | None
Transaction to join. Omit to submit without an explicit transaction. Defaults to None.