AspBlock.Attached
event · AspBlock · cAlgo.API
DesktopCLICloud
Occurs when block attached.
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
event Action<AspBlockAttachedEventArgs> Attached;
aspBlock.Attached += handler # handler(obj: AspBlockAttachedEventArgs)
Examples
protected override void OnStart()
{
var block = Asp.SymbolTab.AddBlock("My Block");
block.Attached += OnBlockAttached;
}
private void OnBlockAttached(AspBlockAttachedEventArgs args)
{
Print("Block attached: {0}", args.AspBlock.Title);
}
def on_start(self):
block = api.Asp.SymbolTab.AddBlock("My Block")
block.Attached += self.on_block_attached
def on_block_attached(self, args):
api.Print(f"Block attached: {args.AspBlock.Title}")