1
$\begingroup$

Create a new notebook with the following two input cells:

NotebookWrite[EvaluationNotebook[], Cell[BoxData[ToBoxes[Manipulator[Dynamic[x]]]], "Output"]]

and

y = 10  (* dummy cell *)

If you evaluate the whole notebook (Evaluation menu\Evaluate Notebook), you will see the manipulator appear then quickly disappear.

If you manually evaluate the first cell, the manipulator will not disappear.

Why is this happening?

$\endgroup$

1 Answer 1

1
$\begingroup$

NotebookWrite print the cell after the selection. Evaluate Notebook select whole notebook and evaluate this. Therefore, your cell is printed in the end of the notebook. Evaluation of the last cell overwrite the output.

You can use CellPrint[...] instead of NotebookWrite[EvaluationNotebook[], ...].

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.