AbstractStageColumnDelegate#

class omni.kit.widget.stage.AbstractStageColumnDelegate#

Bases: object

An abstract object that is used to build stage widget columns.

Methods

build_header(**kwargs)

Builds the header widget.

build_widget(item, **kwargs)

Builds the widget for the given path.

destroy()

Place to release resources.

on_header_hovered(hovered)

Callback when header area is hovered.

on_stage_items_destroyed(items)

Called when stage items are destroyed to give the opportunity for delegates to release corresponding resources.

Attributes

initial_width

The initial width of the column.

minimum_width

The minimum width of the column.

order

The order to sort columns.

resizable

Whether the column is resizable.

sortable

Whether this column is sortable or not.

__init__()#
build_header(**kwargs)#

Builds the header widget. If the column is sortable, stage widget will build a background rectangle with hover state to indicate users if the column is sortable, so that all columns delegates don’t need to build that by themselves. This can be overriden to build customized widgets as column header.

abstract async build_widget(
item: StageColumnItem,
**kwargs,
)#

Builds the widget for the given path. Works inside a ui.Frame in async mode. Once the widget is created, it will replace the content of the frame. It allows to await something for a while and creates the widget when the result is available.

Parameters:

item (StageColumnItem) – DEPRECATED. It includes the non-cached simple prim information. It’s better to use keyword argument `stage_item` instead, which provides cached rich information about the prim influened by this column.

Keyword Arguments:
  • stage_model (StageModel) – The instance of current StageModel.

  • stage_item (StageItem) – The current StageItem to build. It’s possible that stage_item is None when TreeView enabled display of root node.

destroy()#

Place to release resources.

on_header_hovered(hovered: bool)#

Callback when header area is hovered.

Parameters:

hovered (bool) – Whether the header area is hovered.

on_stage_items_destroyed(
items: List[StageItem],
)#

Called when stage items are destroyed to give the opportunity for delegates to release corresponding resources.

Parameters:

items (List[StageItem]) – Stage items to be destroyed.

property initial_width: Pixel | Fraction | Percent#

The initial width of the column.

Returns:

Column width

Return type:

Union[ui.Pixel, ui.Fraction, ui.Percent]

property minimum_width: Pixel | Fraction | Percent#

The minimum width of the column.

Returns:

Minimum column width

Return type:

Union[ui.Pixel, ui.Fraction, ui.Percent]

property order: int#

The order to sort columns. The columns are sorted in ascending order from left to right of the stage widget. So the smaller the order is, the closer the column is to the left of the stage widget.

Returns:

sort order

Return type:

int

property resizable#

Whether the column is resizable. If it’s True, the column can be resized by dragging its border lines. If it’s False, the column can’t be resized. The default value is True.

Returns:

resizable or not

Return type:

bool

property sortable: bool#

Whether this column is sortable or not. When it’s True, stage widget will build header widget with hover and selection state to tell user it’s sortable. This is only used to indicate to users that this column is sortable from the UX point of view.

Returns:

sortable or not

Return type:

bool