Maplets[Elements] - Maple Programming Help

Home : Support : Online Help : Programming : Maplets : Elements : Command Elements : Maplets/Elements/RunWindow

Maplets[Elements]

 RunWindow
 display a window

 Calling Sequence RunWindow(opts)

Parameters

 opts - equation(s) of the form window=value; specify options for the RunWindow element

Description

 • The RunWindow command element displays a window defined in the running Maplet application. To display a window defined in a different Maplet application, use the Display function.
 • There are separate RunDialog and RunWindow command elements because the Window element is intrinsically different from the dialog elements. A dialog has a predefined structure. A Maplet application author can specify options for a dialog, but cannot add elements. A window does not have a predefined structure. A Maplet application author specifies its structure by using elements and options. Also they behave differently. For example, a window can be minimized.
 • 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 window option

 • A RunWindow element cannot contain other elements.
 • A RunWindow element can be contained in a Maplet element; in an equation for the onapprove, oncancel, onchange, onclick, ondecline, or onstartup option for an element; or wrapped in an Action element as a parameter in an element that accepts an onchange or onclick option without an equation.
 • The following table describes the control and use of the RunWindow 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 window x x

 • The opts argument can contain one or more of the following equations that set Maplet application options.
 window = reference to a Window element (name or string)
 A reference to the window to run.
 • Note: In the Standard Worksheet, RunWindow displays a window and sets its parent to be the window that is currently running and enabled. If there are no other windows running, then the window does not have a parent. CloseWindow closes a window and also closes its child windows. In the Classic Worksheet and Command-line interface, RunWindow displays a window, but it does not set a parent.  CloseWindow closes a window. For more information, see compatibility.

Examples

In this Maplet application, RunWindow displays a Window element defined in the same Maplet application.

 > $\mathrm{with}\left(\mathrm{Maplets}\left[\mathrm{Elements}\right]\right):$
 > $\mathrm{maplet}≔\mathrm{Maplet}\left('\mathrm{onstartup}'='\mathrm{A1}',\mathrm{Window}\left['\mathrm{W1}'\right]\left('\mathrm{title}'="Differentiation and Integration",'\mathrm{layout}'='\mathrm{BL0}'\right),\mathrm{BoxLayout}\left['\mathrm{BL0}'\right]\left(\mathrm{BoxColumn}\left(\mathrm{BoxRow}\left("Select a method"\right),\mathrm{BoxRow}\left(\mathrm{Button}\left("Differentiation",\mathrm{Action}\left(\mathrm{CloseWindow}\left('\mathrm{W1}'\right),\mathrm{RunWindow}\left('\mathrm{W2}'\right)\right)\right),\mathrm{Button}\left("Integration",\mathrm{Action}\left(\mathrm{CloseWindow}\left('\mathrm{W1}'\right),\mathrm{RunWindow}\left('\mathrm{W3}'\right)\right)\right)\right)\right)\right),\mathrm{Window}\left['\mathrm{W2}'\right]\left('\mathrm{title}'="Differentiation",\left[\left["Enter an expression:",\mathrm{TextField}\left['\mathrm{TF1}'\right]\left(\right)\right],\left[\mathrm{Button}\left("Differentiate with respect to x",\mathrm{Evaluate}\left('\mathrm{TF1}'='\mathrm{diff}\left(\mathrm{TF1},x\right)'\right)\right),\mathrm{Button}\left("Exit",\mathrm{Shutdown}\left(\left['\mathrm{TF1}'\right]\right)\right)\right]\right]\right),\mathrm{Window}\left['\mathrm{W3}'\right]\left('\mathrm{title}'="Integration",\left[\left["Enter an integrand:",\mathrm{TextField}\left['\mathrm{TF2}'\right]\left(\right)\right],\left[\mathrm{Button}\left("Integrate with respect to x",\mathrm{Evaluate}\left('\mathrm{TF2}'='\mathrm{int}\left(\mathrm{TF2},x\right)'\right)\right),\mathrm{Button}\left("Exit",\mathrm{Shutdown}\left(\left['\mathrm{TF2}'\right]\right)\right)\right]\right]\right),\mathrm{Action}\left['\mathrm{A1}'\right]\left(\mathrm{RunWindow}\left('\mathrm{W1}'\right)\right)\right):$
 > $\mathrm{Maplets}\left[\mathrm{Display}\right]\left(\mathrm{maplet}\right)$

In this Maplet application, Display displays Window elements defined in Maplet applications different from the running Maplet application.

 > $\mathrm{with}\left(\mathrm{Maplets}\left[\mathrm{Elements}\right]\right):$
 > $\mathrm{maplet}≔\mathrm{Maplet}\left('\mathrm{onstartup}'='\mathrm{A1}',\mathrm{Window}\left['\mathrm{W1}'\right]\left('\mathrm{title}'="Select Tutorial",'\mathrm{layout}'='\mathrm{BL1}'\right),\mathrm{BoxLayout}\left['\mathrm{BL1}'\right]\left(\mathrm{BoxColumn}\left(\mathrm{BoxRow}\left("Select a tutorial"\right),\mathrm{BoxRow}\left(\mathrm{Button}\left("Differentiation",\mathrm{Evaluate}\left('\mathrm{function}'='\mathrm{Maplets}\left[\mathrm{Display}\right]\left(\mathrm{maplet2}\right)'\right)\right),\mathrm{Button}\left("Integration",\mathrm{Evaluate}\left('\mathrm{function}'='\mathrm{Maplets}\left[\mathrm{Display}\right]\left(\mathrm{maplet3}\right)'\right)\right)\right),\mathrm{BoxRow}\left(\mathrm{Button}\left("Exit",\mathrm{Shutdown}\left(\right)\right)\right)\right)\right),\mathrm{Action}\left['\mathrm{A1}'\right]\left(\mathrm{RunWindow}\left('\mathrm{W1}'\right)\right)\right):$
 > $\mathrm{maplet2}≔\mathrm{Maplet}\left(\mathrm{Window}\left['\mathrm{W2}'\right]\left('\mathrm{title}'="Differentiation Practice",'\mathrm{layout}'='\mathrm{BL2}'\right),\mathrm{BoxLayout}\left['\mathrm{BL2}'\right]\left(\mathrm{BoxColumn}\left(\mathrm{BoxRow}\left("Enter an expression:",\mathrm{TextField}\left['\mathrm{TF1}'\right]\left(\right)\right),\mathrm{BoxRow}\left(\right),\mathrm{BoxRow}\left("After manually calculating the derivative, check your answer by clicking the Differentiate button."\right),\mathrm{BoxRow}\left(\mathrm{Button}\left("Differentiate with respect to x",\mathrm{Evaluate}\left('\mathrm{TF1}'='\mathrm{diff}\left(\mathrm{TF1},x\right)'\right)\right),\mathrm{Button}\left("Return to Main Menu",\mathrm{Shutdown}\left(\right)\right)\right)\right)\right)\right):$
 > $\mathrm{maplet3}≔\mathrm{Maplet}\left(\mathrm{Window}\left['\mathrm{W3}'\right]\left('\mathrm{title}'="Integration Practice",'\mathrm{layout}'='\mathrm{BL3}'\right),\mathrm{BoxLayout}\left['\mathrm{BL3}'\right]\left(\mathrm{BoxColumn}\left(\mathrm{BoxRow}\left("Enter an integrand:",\mathrm{TextField}\left['\mathrm{TF2}'\right]\left(\right)\right),\mathrm{BoxRow}\left(\right),\mathrm{BoxRow}\left("After manually calculating the anti-derivative, check your answer by clicking the Integrate button."\right),\mathrm{BoxRow}\left(\mathrm{Button}\left("Integrate with respect to x",\mathrm{Evaluate}\left('\mathrm{TF2}'='\mathrm{int}\left(\mathrm{TF2},x\right)'\right)\right),\mathrm{Button}\left("Return to Main Menu",\mathrm{Shutdown}\left(\right)\right)\right)\right)\right)\right):$
 > $\mathrm{Maplets}\left[\mathrm{Display}\right]\left(\mathrm{maplet}\right)$