DocumentTools[Canvas][Script]
ClearGroup
clear the elements from the active canvas group
Calling Sequence
Description
Examples
Compatibility
ClearGroup()
The ClearGroup command removes the math and text contents of the active canvas group, leaving the group intact with a single empty math container inside. Designate which group to clear by using the SetActive command prior to calling ClearGroup.
A "canvas" is an interactive section of a Maple document created by the NewCanvas command, or a shared web-based Maple Learn document. See the Script command for a more complete description.
In this example, we will create a canvas, then use a script to change an entry and then clear the group.
Create a canvas with a group of items and a button that clears the group and then inserts new text
with⁡DocumentTools:-Canvas
ClearGroup := proc(canvas) local sc := Script(); SetActive(sc,"G"); ClearGroup(sc); SetText(sc,"insert after clear"); ToString(sc); end proc:
cv≔NewCanvas⁡Test ClearGroup,Group⁡Text⁡text,custom=T,1,2,3,custom=G,ScriptButton⁡Clear Group,ClearGroup,position=500,60:
ShowCanvas⁡cv
The DocumentTools:-Canvas:-Script:-ClearGroup command was introduced in Maple 2023.
For more information on Maple 2023 changes, see Updates in Maple 2023.
See Also
Annotate
GetMath
Script
SetActive
Download Help Document