SearchWidget

class omni.kit.window.extensions.ext_components.SearchWidget(on_search_fn: Callable[[str], None])

Bases: object

String field with a label overlay to type search string into.

Parameters

on_search_fn (Callable[[str], None]) – Function called with the search string.

Methods

__init__(on_search_fn)

Initializes the search widget and sets up the search field with callback.

clear_filters()

Clears all filters currently applied to the search.

destroy()

Cleans up resources and subscriptions.

get_filters()

Gets the current set of filters applied to the search.

get_text()

Gets the current text from the search field.

set_text(text)

Sets the search text in the search field.

toggle_filter(filter_to_toggle)

Toggles a filter on or off in the current search filters.

__init__(on_search_fn: Callable[[str], None])

Initializes the search widget and sets up the search field with callback.

clear_filters()

Clears all filters currently applied to the search.

destroy()

Cleans up resources and subscriptions.

get_filters()

Gets the current set of filters applied to the search.

Returns

The list of current filters.

Return type

list

get_text()

Gets the current text from the search field.

Returns

The current text in the search field.

Return type

str

set_text(text)

Sets the search text in the search field.

Parameters

text (str) – The text to set in the search field.

toggle_filter(filter_to_toggle)

Toggles a filter on or off in the current search filters.

Parameters

filter_to_toggle (str) – The filter to toggle.