Skip to content

MainMenuBottomCustomItem.Handler

property · MainMenuBottomCustomItem · cAlgo.API Since 5.4

DesktopCLICloud

Get / set handler of bottom item.

Environment behaviour

CLI — not supported. Available to plugins only, and plugins cannot run in the CLI.

Cloud — not supported. Available to plugins only, and plugins cannot run in the cloud.

Definition

Action Handler {get; set;}
mainMenuBottomCustomItem.Handler: Action

Returns Action

Examples

var icon = new SvgIcon("<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><circle cx='8' cy='8' r='6' fill='#2F4BFF' /></svg>");
var bottomItem = MainMenu.AddBottomItem("My Action", icon);
bottomItem.Handler = () => Print("Bottom item clicked at {0}", Server.Time);
from System import Action
icon = SvgIcon("<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><circle cx='8' cy='8' r='6' fill='#2F4BFF' /></svg>")
bottomItem = api.MainMenu.AddBottomItem("My Action", icon)
bottomItem.Handler = Action(lambda: api.Print(f"Bottom item clicked at {api.Server.Time}"))