DocumentTools[Canvas]
ScriptCheckBox
create a checkbox element for a canvas
Calling Sequence
Parameters
Description
Examples
Compatibility
ScriptCheckBox(caption)
ScriptCheckBox(caption, options)
caption
-
string
position
(optional) [x,y], or identical(below,right)
ischecked
(optional) truefalse
custom
The ScriptCheckBox command creates a canvas "checkbox" element, which, can be queried from the canvas during a button action.
By default, ischecked = false
The position option can be used to specify absolute coordinates for the location of the button on a canvas, or a relative position below or to the right of the previous component.
with⁡DocumentTools:-Canvas:
testcheckbox := proc (canvas) local M; M := GetElements(canvas,"checkbox"); local sc := Script(); SetActive(sc,"out"); SetText(sc,`if`(M[1]:-ischecked=true,"Checked","Not Checked") ); ToString(sc); end proc:
cv≔NewCanvas⁡ScriptCheckBox⁡Caption A,custom=A,Text⁡,custom=out,ScriptButton⁡Test,testcheckbox:
ShowCanvas⁡cv
The DocumentTools[Canvas][ScriptCheckBox] command was introduced in Maple 2022.
For more information on Maple 2022 changes, see Updates in Maple 2022.
See Also
Annotate
GetCanvas
GetMath
Math
NewCanvas
Script
ScriptButton
ShareCanvas
Text
Download Help Document