0

The following code remains in the prompt state within the InputField after execution.

Manipulate[output, 
Style[ EventHandler[ Control@{{in, "N[Pi,10]"}, InputField[#, Boxes] &, 
ImageSize -> {400, 50}},
{"MenuCommand", "HandleShiftReturn"} :> { output = ToExpression@in }, 
PassEventsDown -> False, Method -> "Queued"], 20]] 

enter image description here

I added the error message here to be deleted from the next run.

Manipulate[output, 
Style[EventHandler[ Control@{{in, "N[Pi,10]"}, InputField[#, Boxes] &,
ImageSize -> {400, 50}},
{"MenuCommand", "HandleShiftReturn"} :> { 
 NotebookFind[SelectedNotebook[], "Message", All, CellStyle];
 NotebookDelete[]; output = ToExpression@in}, 
PassEventsDown -> False, Method -> "Queued"], 20]] 

However, the prompt state was taken out of InputField.

enter image description here

How do I keep the prompt status in InputField even after I run it?

Milk
  • 1,688
  • 10
  • 9

0 Answers0