Appending Actions to the Context Menu System - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim

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.


For example, the following is the definition of a simple action that squares an integer. For more information regarding entries, see Creating Custom Context Menu Entries.

newCM:-Entries:-Add( "Square an Integer", "%EXPR^2", integer,
                     helpstring = "Find the square of an integer");


3.  Install the customized context menu system using the ContextMenu[Install] command.


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/");



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







Creating a Context Menu System

Creating Custom Context Menu Entries

Overview of Creating Context Menus