1
$\begingroup$

I like "Evaluate In Place," because it hides code and works well. However, I can't figure out how to return to the original code when I want to modify it. I'm sure there is an easy way, but I can't find it in the documentation. Here is the code. FileNames["Index.xls"] is in the PopupMenuBox function.

If I select the popup box and Ctrl-Shft-E I can see evaluated code with inside of Cell[long expression,"Input"], I cant really untangle it.

enter image description here

$\endgroup$
  • $\begingroup$ " the output is pasted over the selected input ". I'd interpret that to mean the input is gone. ( Though undo works if you need to revert immediately afterwards ) $\endgroup$ – george2079 Mar 16 '16 at 16:46
  • 1
    $\begingroup$ As @george2079 mentioned, once you evaluate the code, the result of such evaluation replaces the previously existing code rather than "hiding" it. In some cases you may be able to get the code back through Undo, but that's it, I'm afraid. $\endgroup$ – MarcoB Mar 16 '16 at 18:30
1
$\begingroup$

Here is a way to solve my problem (that I can't change the original code) with Evaluate In Place. Define a function for the PopupMenu and evaluate an instance of the function in place:

pub[var_, list_] := PopupMenu[Dynamic[val], list]
pub[x, FileNames["*Index.xls*"]]

I've overwritten only an instance of the function, and have not lost any code.

**** I ONLY THOUGHT THIS WAS WORKING. APPARENTLY DYNAMIC IN A FUNCTION DOESN'T TALK TO THE OUTSIDE WORLD. IS THAT TRUE? ****

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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