Stay organized with collections Save and categorize content based on your preferences.

blockly > WorkspaceSvg > registerButtonCallback

WorkspaceSvg.registerButtonCallback() method

Register a callback function associated with a given key, for clicks on buttons and labels in the flyout. For instance, a button specified by the XML should be matched by a call to registerButtonCallback("CREATE_VARIABLE", yourCallbackFunction).


registerButtonCallback(key: string, func: (p1: FlyoutButton) => void): void;


Parameter Type Description
key string The name to use to look up this function.
func (p1: FlyoutButton) => void The function to call when the given button is clicked.