Creating a Custom Dialog Box
Mark the Cell That Initiates the Dialog So That the Output Can Be Returned in the Proper Location
This cell identifies the notebook that will receive the output of the dialog and identies a reference point (by marking the cell with a tag) for moving the selection by kernel commands.
Create the Notebook Dialog and Fill It with the Desired Cells
The NotebookWrite commands in this example create a Text cell with a prompt for the user and an empty Input cell into which the user will type. The longer example at the end of this section uses a NotebookWrite to place a button in the dialog notebook window.
The cells in the dialog that you want to manipulate (such as cells you read input from) should have the option
Assign Out[$Line] the Return Value of the Dialog
Select the cell (or cells) in the dialog which contain input, read in the contents of those cells, use the input to calculate the output, and then set
Return the Output of the Dialog to the Original Notebook
This places the output (
Put It All Together
Here is a basic example that incorporates the above ideas.
Evaluate the input cell below (
The created notebook contains an instruction prompt, an empty cell where the user can type input, and a Return button to send the output back to calling notebook. After a value is typed into the input cell but before the button is clicked, the generated dialog window looks like this:
Converted by Mathematica October 8, 1999 [Prev Page][Next Page]