Creating a 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


Creating a Context Menu System

  

You can create actions and install new context menus.

  

1.  Create a new context menu module and assign it to a name.

with(ContextMenu);

newCM := New();

  

2.  Create the menu entries to be included in the new context menu 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.

Install(newCM);

  

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. To access both your user-defined actions and the existing context menu system, see Appending Actions to the Context Menu System.

  

3.  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].

  

4.  An annotated example worksheet describing how to build a context system is available.

  

5.  You cannot create actions that act on plots or spreadsheets, only mathematical objects and expressions.

See Also

About Creating Context Menus

Appending Actions to the Context Menu System

ContextMenu

ContextMenu Example Worksheet

ContextMenu[CurrentContext]

ContextMenu[CurrentContext][Copy]

ContextMenu[Install]

ContextMenu[New]

ContextMenu[Test]

Creating Custom Context Menu Entries

Overview of Creating Context Menus