FileMenuDelegate

class omni.kit.menu.file.scripts.file.FileMenuDelegate

Bases: IconMenuDelegate

A delegate class for customizing the appearance and behavior of the File menu.

This class provides methods to determine the length of displayed text in the menu, specifically for the ‘Open Recent’ menu, allowing for an ellipsis to be used on longer file paths.

Methods

get_elided_length(menu_name)

Determines the maximum pixel width of text that can be displayed for a given menu.

Attributes

__init__(self: omni.ui._ui.MenuDelegate, **kwargs) None

Constructor.

`kwargsdict`

See below

### Keyword Arguments:

`on_build_item`

Called to create a new item.

`on_build_title`

Called to create a new title.

`on_build_status`

Called to create a new widget on the bottom of the window.

`propagate`

Determine if Menu children should use this delegate when they don’t have the own one.

get_elided_length(menu_name)

Determines the maximum pixel width of text that can be displayed for a given menu.

Parameters

menu_name (str) – The name of the menu to check for text elision.

Returns

The maximum pixel width of the text allowed in the menu or 0 if no limit.

Return type

int