FileBrowserGridView

class omni.kit.widget.filebrowser.grid_view.FileBrowserGridView(model: FileBrowserModel, **kwargs)

Bases: FileBrowserView

UI Widget for display files or folders as icons in a directory in grid view.

Keyword Arguments
  • allow_multi_selection (bool) – Optional argument to enable multi selection, defaults to True.

  • selection_changed_fn (Callable) – Function called when selection changed. Function signature: void selection_changed_fn(selections: List[FileBrowserItem])

Methods

__init__(model, **kwargs)

build_ui([restore_selections])

Build the UI of the grid view.

destroy()

Destructor.

refresh_ui([item, selections])

Throttle the refreshes so that the UI can keep up with multiple refresh directives in succession.

scale_view(scale)

Change the scale of items inside the grid view.

scroll_top()

Scroll the widget to top

select_and_center(item[, callback])

Select and center the view on the given item.

Attributes

selections

__init__(model: FileBrowserModel, **kwargs)
build_ui(restore_selections: Optional[List[FileBrowserItem]] = None)

Build the UI of the grid view.

Keyword Arguments

restore_selections (List[FileBrowserItem]) – List of file browser items to restore selection to.

destroy()

Destructor.

refresh_ui(item: Optional[FileBrowserItem] = None, selections: Optional[List[FileBrowserItem]] = None)

Throttle the refreshes so that the UI can keep up with multiple refresh directives in succession.

Keyword Arguments
  • item (FileBrowserItem) – Unused argument, kept for compatibility.

  • selection (List[FileBrowserItem]) – List of file browser items to set the new selection to.

scale_view(scale: float)

Change the scale of items inside the grid view. :param scale: the new scale to set. :type scale: float

scroll_top()

Scroll the widget to top

select_and_center(item: FileBrowserItem, callback: Optional[Callable[[FileBrowserItem], None]] = None)

Select and center the view on the given item.

Parameters
  • item (FileBrowserItem) – the item to set the new selection to.

  • callback (Callable) – optional callback to call after setting the selection. Function signature: void(item: FileBrowserItem)