Appending Actions to the Context Menu System
|
You can supplement the default context menu system with user-defined actions.
|
|
1. Create a copy of the built-in context menu module and assign it to a name.
|
>
|
newCM := CurrentContext[Copy]();
|
|
2. Create the menu entries to be appended to the Maple system.
|
>
|
newCM:-Entries:-Add( "Square an Integer", "%EXPR^2", integer,
helpstring = "Find the square of an integer");
|
|
By completing this step, the context configuration is installed. Your actions are enabled in the Maple context menu system of the current session.
|
|
4. Save the context menu module for use in subsequent Maple sessions.
|
|
This optional step ensures your customized context menu module is available for use in future sessions, by placing it in a Maple archive. For details, see ContextMenu[Save].
|
>
|
Save(newCM, "/usr/local/maple/");
|
|
Notes:
|
|
|
1. Once the appended context configuration is installed, it replaces the default context menu system for the current session. The default system can be restored by using the ContextMenu[Install]() command.
|
|
2. The ContextMenu package provides several tools for programmatically testing your context menu system, independent of whether it is installed. For more information, see ContextMenu[Test].
|
|
3. An annotated example worksheet describing how to build a context system is available.
|
|
4. You cannot create actions that act on plots or spreadsheets, only mathematical objects and expressions.
|
|
|
See Also
|
|
About Creating Context Menus, Context Menu Example Worksheet, ContextMenu, ContextMenu[CurrentContext], ContextMenu[CurrentContext][Copy], ContextMenu[Install], ContextMenu[New], ContextMenu[Test], Creating a Context Menu System, Creating Custom Context Menu Entries, Overview of Creating Context Menus
|
|
Download Help Document
Was this information helpful?