Message Boards Message Boards

1
|
4872 Views
|
4 Replies
|
5 Total Likes
View groups...
Share
Share this post:

[Solved] Using a button to delete an output

Hi,

I created a little code to show my problem.

Manipulate[
 x + 1,
 Column[{
   Control@{x, 0, 9, 1},
   Button["Delete this application", "???"]
   }]
 ]

How do I delete the application output using the button? You cannot use "out [n]" for this, because when you run the code again, "n" changes its value.

I'll appreciate any help. Anderson

POSTED BY: Anderson Gaudio
4 Replies

Dear Kuba, Your code solved the problem. Thank you very much.

Best regards, Anderson

POSTED BY: Anderson Gaudio

Dear Neil,

The notebook where the real application is inserted contains other applications whose results are used here and there. If all the outputs are erased, unfortunately there will be data loss. Thanks a lot, Anderson

POSTED BY: Anderson Gaudio

This should do the job:

Button["Delete this application", NotebookDelete@EvaluationCell[]]
POSTED BY: Kuba Podkalicki

Anderson,

This button will delete all output cells and reset a notebook:

Button["Reset Notebook", FrontEndExecute[
     FrontEndToken["DeleteGeneratedCells"]]]

Regards,

Neil

POSTED BY: Neil Singer
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract