This example shows how to use the checkbox component.
The windowHandle parameter refers to the active window. When the checkbox value changes
then the onCheckboxFormCheckboxChange procedure is called.
Since the status light is on the same window as the checkbox, the windowHandle parameter
can be used to address the status light.
"Checkbox example" "lib/modules/standard.whl" "lib/modules/components/component.whl" "lib/modules/components/form.whl" "lib/modules/components/checkbox.whl" "lib/modules/components/statusLight.whl" CHECKBOX_FORM_CHECKBOX 0xFD9D281F CHECKBOX_FORM_STATUS_LIGHT 0x112F9C00 "checkbox.wfrm" number colors[2] = [COMPONENT_COLOR_GRAY, COMPONENT_COLOR_YELLOW] ; @proc Checkbox onChange event. ; @param windowHandle The handle to the active window. ; @param value The checkbox value. proc onCheckboxFormCheckboxChange(number windowHandle, number value) components.statusLight.setColor(windowHandle, CHECKBOX_FORM_STATUS_LIGHT, colors[value]) end ; @proc Show the form. ; @ret The handle to the form. proc showCheckboxFormForm() ret components.form.show("checkbox.wfrm") end proc main() showCheckboxFormForm() halt() end