omni.kit.widget.browser_bar

A UI widget that adds navigation history to the PathField.

The PathField widget supes up tree navigation via keyboard entry. This widget extends that experience further by queuing up the user’s navigation history. As in any modern day browser, the user can then directly jump to any previously visited path.

Example:

browser_bar = BrowserBar(
    visited_history_size=20,
    branching_options_provider=branching_options_provider,
    apply_path_handler=apply_path_handler,
)
class omni.kit.widget.browser_bar.BrowserBar(**kwargs)

Bases: object

The Browser Bar extends the PathField UI widget for navigating tree views via the keyboard. Namely, it adds navigation history. As in any modern day browser, this allows the user to diectly jump to any previously visited path.

Parameters

None

Keyword Arguments
  • visited_history_size (int) – Maximum number of previously visited paths to queue up. Default 10.

  • apply_path_handler (Callable) – This function is called when the user updates the path and is expected to update the caller app accordingly. The user can update the path in one of 3 ways: 1. by hitting Enter on the input field, 2. selecting a path from the dropdown, or 3. by clicking on the “prev” or “next” buttons. 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_handler(path: str, callback: func)

destroy()
property path

Returns the current path as entered in the field box.

Type

str

set_path(path: str)

Sets the path and adds it to the history queue.

Parameters

path (str) – The full path name.