Maplet - Maple Help

Maplets[Elements]

 Maplet
 encapsulate a Maplet application definition

 Calling Sequence Maplet(opts, element_content) Maplet[refID](opts, element_content)

Parameters

 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

Description

 • 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 refID 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 x reference x

 • 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.

Examples

 > $\mathrm{with}\left(\mathrm{Maplets}\left[\mathrm{Elements}\right]\right):$
 > $\mathrm{maplet}≔\mathrm{Maplet}\left(\left[\left["Hello world"\right]\right]\right):$
 > $\mathrm{Maplets}\left[\mathrm{Display}\right]\left(\mathrm{maplet}\right)$

An example using 'onstartup'.

 > f := proc()     Maplets:-Tools:-Set(TF="using onstartup"); end proc:
 > $\mathrm{maplet}≔\mathrm{Maplet}\left(\mathrm{onstartup}=\mathrm{Action}\left(\mathrm{RunWindow}\left(\mathrm{Main}\right),\mathrm{Evaluate}\left(\mathrm{function}="f"\right)\right),\mathrm{Window}\left[\mathrm{Main}\right]\left(\left[\mathrm{TextBox}\left[\mathrm{TF}\right]\left(\right)\right]\right)\right):$
 > $\mathrm{Maplets}\left[\mathrm{Display}\right]\left(\mathrm{maplet}\right)$