Maplets[Elements]
Maplet
encapsulate a Maplet application definition
Calling Sequence
Parameters
Description
Examples
Maplet(opts, element_content)
Maplet[refID](opts, element_content)
opts
-
equation(s) of the form option=value where option is one of abnormalshutdown, onstartup, or reference; specify options for the Maplet element
element_content
any number of elements
refID
name or string; reference to the element
For every Maplet application, the Maplet element encapsulates the elements that constitute the Maplet application definition.
The Maplet element features can be modified by using options. To simplify specifying options in the Maplets package, certain options and contents can be set without using an equation. The following table lists elements, symbols, and types (in the left column) and the corresponding option or content (in the right column) to which inputs of this type are, by default, assigned.
Elements, Symbols, or Types
Assumed Option or Content
name or string
onstartup option
reference option
A Maplet element can contain most elements.
A Maplet element cannot be contained in any element.
The following table describes the control and use of the Maplet element options.
An x in the I column indicates that the option can be initialized, that is, specified in the calling sequence (element definition).
An x in the R column indicates that the option is required in the calling sequence.
An x in the G column indicates that the option can be read, that is, retrieved by using the Get tool.
An x in the S column indicates that the option can be written, that is, set by using the SetOption element or the Set tool.
Option
I
R
G
S
abnormalshutdown
x
onstartup
reference
The opts argument can contain one or more of the following equations that set Maplet application options.
abnormalshutdown = string
A shutdown by using the Close icon. For example, in Windows, clicking the [x] icon in the upper right corner of the Maplet application window title bar.
onstartup = Action or command element, or reference to an Action element (name or string)
The first action that Maplets[Display] executes after the Maplet application has been constructed.
For a simple Maplet application with a single window, this defaults to a call to RunWindow for the single window. For a multi-window Maplet application, this must be specified.
In addition, if actions are to be performed on startup, the RunWindow call must be included in the actions (see the example below).
reference = name or string
A reference for the Maplet element.
If the reference is specified by both an index, for example, Maplet[refID], and a reference in the calling sequence, the index reference takes precedence.
with⁡MapletsElements:
maplet≔Maplet⁡Hello world:
MapletsDisplay⁡maplet
An example using 'onstartup'.
f := proc() Maplets:-Tools:-Set(TF="using onstartup"); end proc:
maplet≔Maplet⁡onstartup=Action⁡RunWindow⁡Main,Evaluate⁡function=f,WindowMain⁡TextBoxTF⁡:
See Also
Maplets/CommandElements
Maplets[Display]
Maplets[Elements][Action]
Maplets[Elements][SetOption]
Maplets[Tools][Get]
Maplets[Tools][Set]
Overview of Maplet Applications
Download Help Document