nanome.api.ui.menu module

class Menu(index=0, title='title')[source]

Bases: nanome._internal.ui.models._Menu

Represents a menu for a plugin
enabled
Determines the visibility of the menu
Type:bool
find_content(content_id)[source]
Finds a piece of content by its content ID.
Parameters:content_id (int) – the ID of the content to find
Returns:The UI content on this menu matching the ID
Return type:UIBase
get_all_content()[source]
Gets all content from this menu
Returns:A list of all UI content on this menu
Return type:list <UIBase>
get_all_nodes()[source]
Gets all LayoutNodes from this menu
Returns:A list of all LayoutNodes on this menu
Return type:list <LayoutNode>
height
The height of the menu
Type:float
index
The index of the menu.
Used to determine a menu’s identity.
Menus with the same index will replace one another when updated.
Type:int
io = <nanome.api.ui.io.menu_io.MenuIO object>
locked
Whether or not the menu is locked in place
Type:bool
register_closed_callback(func)[source]
Registers a function to be called when the menu’s close button is pressed.
Parameters:func (method (Menu) -> None) – called the menu is closed
root
The hierarchical root LayoutNode of the menu
Type:LayoutNode
title
The title which appears at the top of the menu
Type:str
width
The width of the menu
Type:float