bool OnContextMenu()

robot_2Generated
code_blocksInput

Description

The OnContextMenu method is invoked when a tree node is right-clicked. This method can be overridden to provide custom context menu behavior for a tree node. By default, it returns false, allowing the default context menu behavior to proceed. If you override this method and return true, the default context menu behavior will be suppressed, allowing you to implement custom logic.

Usage

Override this method in a derived class to customize the context menu behavior for a tree node. Return true if you want to handle the context menu event yourself and prevent the default behavior. Return false to allow the default context menu to be displayed.

Example

public class CustomTreeNode : Editor.TreeNode
{
    public override bool OnContextMenu()
    {
        // Custom context menu logic here
        // Return true to suppress default context menu
        return true;
    }
}