PathField#
- class omni.kit.widget.path_field.PathField(**kwargs)#
Bases:
objectMain class for the PathField widget. This widget is a UI alternative to omni.ui.StringField for navigating tree views with the keyboard. As the user navigates the tree using TAB, Backspace, and Arrow keys, they are constantly provided branching options via auto-filtered tooltips.
- Parameters:
None
- Keyword Arguments:
apply_path_handler (Callable) – This function is called when the user hits Enter on the input field, signaling that they want to apply the path. This handler is expected to update the caller’s app accordingly. Function signature: void apply_path_handler(path: str)
branching_options_handler (Callable) – This function is required to provide a list of possible branches whenever prompted with a path. For example, if path = “C:”, then the list of values produced might be [“Program Files”, “temp”, …, “Users”]. Function signature: list(str) branching_options_provider(path: str, callback: func)
separator (str) – Character used to split a path into list of branches. Default ‘/’.
modal (bool) – Used for modal window. Default False.
begin_edit_handler (callable) – A callback for path string field begin edit. Default None.
Methods
__init__(**kwargs)Constructor for the PathField class.
destroy()Destructor.
set_path(full_path)Sets the path.
Attributes
Gets the current path as entered in the field box.
- __init__(**kwargs)#
Constructor for the PathField class.
- destroy()#
Destructor.
- set_path(full_path: str)#
Sets the path.
- Parameters:
full_path (str) – The full path name to set.
- property path: str#
Gets the current path as entered in the field box.
- Returns:
The current path.
- Return type:
str