The PUSHBUTTON widget is a stand-alone button that can be placed anywhere on the screen or in a PANEL.
Clicking the mouse button (or pressing the Spacebar or theReturn key) while the focus in on the PUSHBUTTON causes an ACTIVATED event to be generated. For example, if you execute the following statements, when you click on the "Push Me" button the "Handler" routine will be executed.
ASSIGN @Btn TO WIDGET "PUSHBUTTON"; SET ("LABEL":"Push Me")
ON EVENT @Btn, "ACTIVATED" GOSUB Handler
If you specify a string array as a parameter to LABELS, and specify the number of elements in the array with the STATES attribute, PUSHBUTTON will cycle through the different labels. You can query the current PUSHBUTTON label setting with the STATE attribute.
Clicking the mouse button (or pressing the Spacebar or theReturn key) while the focus is on the PUSHBUTTON causes an ACTIVATED event to be generated. PUSHBUTTON can be a multi-state device (see LABEL and STATES attributes) where each push of the button cycles to the next state.
Events
Events for the PUSHBUTTON widget are:
·
ACTIVATED
·
SYSTEM MENU
ACTIVATED
This event occurs only when the mouse button is pushed and released
while the the cursor is within the border of the PUSHBUTTON.
SYSTEM MENU
This event is generated when the operator selects items from the SYSTEM MENU.