ui.createButton
Description
Creates a custom button as a child of the specified control.

Parameters
parentHandle integer
component name integer
x integer
y integer
w integer
h integer
caption string

Return value
controlID integer

Example
-- get handle to current Stock Tracker window
local parentHandle = ui.getHandle(HANDLE_CURRENT_WINDOW)

-- create button within current Stock Tracker window
ui.createButton(parentHandle, "custom__button_1", 16, 16, 160, 32, "Press Me")

Comments
Use ui.getHandle() to get a valid parent handle first.

Component name must not contain spaces or certain characters and be unique within the direct parent's scope.
Good: "my_button_1" or "MyButton1"
Bad: "My button 1"

Return value is controlID or -1 if failed to create.

See also
ui.deleteControl
ui.getHandle

Back
Generated on the 26 June 2024 at 22:01:29 (UK Time)