unreal.ToolMenu

class unreal.ToolMenu(outer: Object | None = None, name: Name | str = 'None')

Bases: ToolMenuBase

Represents a menu in the ToolMenus system.

An instance of this class is returned by basic APIs such as UToolMenus::RegisterMenu and UToolMenus::ExtendMenu.

C++ Source:

  • Module: ToolMenus

  • File: ToolMenu.h

Editor Properties: (see get_editor_property/set_editor_property)

  • allow_tool_bar_wrap_button (‘undefined’): [Read-Write] Whether to (ever) allow the wrap button/overflow menu. Defauls to the style.

  • close_self_only (bool): [Read-Write]

  • menu_name (Name): [Read-Write]

  • menu_owner (ToolMenuOwner): [Read-Write]

  • menu_parent (Name): [Read-Write]

  • menu_type (MultiBoxType): [Read-Write]

  • prevent_customization (bool): [Read-Write] Prevent menu from being customized

  • searchable (bool): [Read-Write]

  • separate_sections (bool): [Read-Write] Whether different sections should have separators automatically added between them.

  • should_close_window_after_menu_selection (bool): [Read-Write]

  • style_name (Name): [Read-Write]

  • tool_bar_force_small_icons (bool): [Read-Write]

  • tool_bar_is_focusable (bool): [Read-Write]

  • tutorial_highlight_name (Name): [Read-Write]

add_dynamic_section(section_name, object) None

Add Dynamic Section Script

Parameters:
add_menu_entry(section_name, args) None

Add Menu Entry

Parameters:
add_menu_entry_object(object) None

Add Menu Entry Object

Parameters:

object (ToolMenuEntryScript)

add_section(section_name, label='', insert_name='None', insert_type=ToolMenuInsertType.DEFAULT, alignment=ToolMenuSectionAlign.DEFAULT) None

Add Section Script

Parameters:
add_sub_menu(owner, section_name, name, label, tool_tip='') ToolMenu

Add Sub Menu Script

Parameters:
Return type:

ToolMenu

property allow_tool_bar_wrap_button: type

[Read-Write] Whether to (ever) allow the wrap button/overflow menu. Defauls to the style.

Type:

(‘undefined’)

property close_self_only: bool

[Read-Write]

Type:

(bool)

init_menu(owner, name, parent='None', type=MultiBoxType.MENU) None

Init Menu

Parameters:
property menu_name: Name

[Read-Write]

Type:

(Name)

property menu_owner: ToolMenuOwner

[Read-Write]

Type:

(ToolMenuOwner)

property menu_parent: Name

[Read-Write]

Type:

(Name)

property menu_type: MultiBoxType

[Read-Write]

Type:

(MultiBoxType)

property prevent_customization: bool

[Read-Write] Prevent menu from being customized

Type:

(bool)

remove_menu_entry_object(object) None

Remove Menu Entry Object

Parameters:

object (ToolMenuEntryScript)

property searchable: bool

[Read-Write]

Type:

(bool)

property separate_sections: bool

[Read-Write] Whether different sections should have separators automatically added between them.

Type:

(bool)

property should_close_window_after_menu_selection: bool

[Read-Write]

Type:

(bool)

property style_name: Name

[Read-Write]

Type:

(Name)

property tool_bar_force_small_icons: bool

[Read-Write]

Type:

(bool)

property tool_bar_is_focusable: bool

[Read-Write]

Type:

(bool)

property tutorial_highlight_name: Name

[Read-Write]

Type:

(Name)