graph_menu_tree#
Classes#
A manager class for NodeGraphMenu's that allows for easy, hierarchical creation and access of submenus. |
Module Contents#
- class graph_menu_tree.HierarchicalMenuTree(graph_menu)#
A manager class for NodeGraphMenu’s that allows for easy, hierarchical creation and access of submenus.
- Init:
graph_menu: NodeGraphMenu, base NodeGraphMenu menu of the NodeGraphQt object
- Parameters:
graph_menu (NodeGraphQt.NodeGraphMenu)
- graph_menu_ref: NodeGraphQt.NodeGraphMenu#
- children: dict[str, HierarchicalMenuTree]#
- __getitem__(path)#
Get / Create a submenu with the given name.
- Input:
path: str | list[str], path of the requested submenu
- Output:
HierarchicalMenuTree, requested submenu
- Parameters:
- Return type:
- add_command(name, func, shortcut=None)#
Add a graph command to current selected menu on the hierarchy.
- Input:
name: str, name for the new command func: tp.Callable, function associated with the new command shortcut: str, keyboard shortcut for the new command