Usage Examples#
Initialize BrowserBar and Set Path#
from omni.kit.widget.browser_bar import BrowserBar
# Initialize the BrowserBar with custom handlers
browser_bar = BrowserBar(
visited_history_size=20,
apply_path_handler=lambda path: print(f"Path applied: {path}"),
branching_options_handler=lambda path, callback: ["Option1", "Option2"]
)
# Set a path and add it to the history
browser_bar.set_path("/path/to/directory")
Clean Up BrowserBar Resources#
from omni.kit.widget.browser_bar import BrowserBar
# Initialize the BrowserBar for demonstration
browser_bar = BrowserBar(
visited_history_size=20,
apply_path_handler=lambda path: print(f"Path applied: {path}"),
branching_options_handler=lambda path, callback: ["Option1", "Option2"]
)
# Assuming 'browser_bar' has already been initialized
# Destroy the BrowserBar to clean up resources
browser_bar.destroy()