SearchField#
- class omni.kit.widget.search_delegate.SearchField(callback: Callable, **kwargs)#
Bases:
SearchDelegate
A search field to input search words
- Parameters:
callback (callable) – Function called after search is done. Function signature: void callback(model: SearchResultsModel)
- Keyword Arguments:
width (Optional[ui.Length]) – Widget width. Default None means auto.
height (Optional[ui.Length]) – Widget height. Default ui.Pixel(26). Use None for auto.
subscribe_edit_changed (bool) – True to retrieve on_search_fn called when input changes. Default False only retrieve on_search_fn called when input ends.
show_tokens (bool) – Default True to show tokens if end editing. Do nothing if False.
- Properties:
visible (bool): Widget visibility. enabled (bool): Enable/disable widget.
Methods
__init__
(callback, **kwargs)Initializes the search field.
build_ui
()Builds the UI components for the search field.
destroy
()Destroys and cleans up search field resources.
search
(search_words)Search using selected search engine.
Attributes
CLOSE_IMAGE_SIZE
SEARCH_IMAGE_SIZE
Gets widget enabled state.
Gets the current search directory.
Gets widget visibility.
- __init__(callback: Callable, **kwargs)#
Initializes the search field.
- build_ui()#
Builds the UI components for the search field.
- destroy()#
Destroys and cleans up search field resources.
- search(search_words: List[str])#
Search using selected search engine.
- Parameters:
search_words (List[str]) – List of search terms.
- property enabled#
Gets widget enabled state.
- Returns:
The current enabled state of the widget.
- Return type:
bool
- property search_dir#
Gets the current search directory.
- Returns:
The current search directory.
- Return type:
str
- property visible#
Gets widget visibility.
- Returns:
The current visibility state of the widget.
- Return type:
bool