Skip to content

Button Test

The Button Test is used in Inspections to trigger custom actions from a script.

Button Test

Settings

Setting Description
Label The display name shown to the operator during the Inspection.
Visible Whether the Test is shown to the operator in the Inspection.
Script ID Identifies how this Test is referenced in Inspection Scripts.
Border Whether to display a visual border around the Test in the Inspection layout.
Freeze Test If this Test is placed on the same row as a taller Test, this Test will not scroll off the screen until the taller Test scrolls off the screen.
Full Width Whether to fit the width of the button to the width of the columns or the width of its label.
Min Height Minimum display height of the button in pixels. It may be useful to make buttons taller on touch devices.
Background Color The button's background color.
Hover Color The button's background color when it is hovered with the mouse.
Text Color The button's label color.

onClick Event

The Button Test is usually used within an Inspection Script by binding to its onClick event, such as

const buttonTest = gsApi.inspection.subInspection('measurements').button('my button');

buttonTest.onClick(async () => {
    // Change the name of the button
    await buttonTest.updateProperties({
        label: 'You clicked me!'
    });
});

See Also