Message Boards Message Boards

1
|
6597 Views
|
2 Replies
|
2 Total Likes
View groups...
Share
Share this post:

How does one modify FrontEnd Tokens for Cell Menu?

Posted 10 years ago

I have two types of input and output cell styles. WorkedInput uses GeneratedCellStyles -> {"Output" -> "WorkedOutput"}.

With this Output, the Cell menu item for "Delete All Output" doesn't delete WorkedOutput cells. This is reasonable, but I'd like to have that functionality for my other output styles.

I note that KeyEventTranslations.tr references the FrontEndToken DeleteGeneratedOutput.

Does anyone know how I might modify KeyEventTranslations.tr or write my own FrontEnd token to delete all types of Output cells? If this is impossible with KeyEventTranslations, would a Palette be a good approach? If a palette would be a good approach, could someone give me a hint how to construct and install such a palette? Thanks, WCC

POSTED BY: W. Craig Carter
2 Replies

Dear Kuba, This works perfectly. Simple and elegant. Well done. Thanks.

POSTED BY: W. Craig Carter
Posted 10 years ago

I can't reproduce your problem but maybe you can use:

NotebookDelete @  Union[Cells[GeneratedCell -> True],   Cells[CellStyle -> "WorkedOutput"]]

to create palette:

CreatePalette[
 Pane[Button["DeleteOutput", 
   NotebookDelete @ Union[Cells[InputNotebook[], GeneratedCell -> True],  Cells[InputNotebook[], CellStyle -> "WorkedOutput"]]], 
  ImageMargins -> 15, Alignment -> Center]
 ]
POSTED BY: Kuba Podkalicki
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