< Previous | Contents | Next >

Button Callbacks

Button callbacks are invoked when custom Button Controls within a tool are clicked.

Internally, the Attribute called BTNCS_Execute needs to be set. The easiest way to accomplish this is by using the UserControls ToolScript. When adding a Button control, a field labeled Execute can be used to call Lua commands.


image


image

BTNCS_Execute = “print(\”Hello\”)”,

LINKS_Name = “Print Hello”,

INP_Default = 0,

LINKID_DataType = “Number”,

PrintHello = {

UserControls = ordered() {

},

},

INPID_InputControl = “ButtonControl”,

The generated button control will end up in the composition as:



image


When clicked “Hello” will be printed in the console.