The Button Object

Example

var btnClose = new TButton('Close');
var wndButtonSample = createWindow('Button Sample');

var onCloseClick = function() {
hideModal();
};

btnClose.setOnClick(onCloseClick);

wndButtonSample.add(new TText('Hello World! This is a button sample'));
wndButtonSample.add(btnClose);
showModal(wndButtonSample);

Button constructor takes two parameters:

var btnClose = new TButton(caption, margin);

Button Methods and Properties
Method/Property Description
disable Disables button object
enable Enables button object
setOnClick Sets an event handler for the click event on the button object. Form: setOnClick(eventHandler)