To programmatically add to menus you can do as described here:
How do I add new menuitems to menus?
What can I do to programmatically add to contextual menus? Is something similar to AddMenuCommands
available?
To programmatically add to menus you can do as described here:
How do I add new menuitems to menus?
What can I do to programmatically add to contextual menus? Is something similar to AddMenuCommands
available?
There's an option ContextMenu
, which you seem to be able to set at cell, notebook, or even box level. They all default to something like
FEPrivate`FrontEndResource["ContextMenus", "something"]
That info seems to be in the ContextMenus.tr file in the $InstallationDirectory
, SystemFiles, FrontEnd, TextResources.
In any case, all that that option needs is a list of MenuItem[...]
. You can look at that file (or at MenuSetup.tr) to get a hang on the syntax. Then it's just setting the option.
Apart from the brute force method of reading the file, creating your own, adding your Menus, and setting that option, I still haven't found a way to "append" the MenuItems. Only to replace... I'll edit if I find something
ComponentwiseContextMenu
option. ContextMenu
is used where you can easily dictate context menus by style, whereas ComponentwiseContextMenu
allows you to determine context menus which belong to certain box types, the various cell-related widgets, etc., which may be difficult or impossible to apply styles to.
$\endgroup$
Commented
Mar 6, 2012 at 15:52