ssCore.Popup.setMenu

Create a new menu using a menu definition string obtained by a call to Popup.getMenu.


Availability:

First available in version 3.0 build 2039.


Input Parameters:

name - A name that you will use to refer to the new menu in all future menu commands.

resource - The menu definition string.


Output Parameters:

No output parameters.


Asynchronous Mode:

When this method is called asynchronously, a return object containing the output parameters is passed to the specified callback function.

ssCore.Popup.setMenu( paramsObject [, callbackParamsObject] [, errorParamsObject] );


Synchronous Mode:

When this method is called synchronously, a return object containing the output parameters is returned to the caller immediately.

var returnObject = ssCore.Popup.setMenu( paramsObject );


Notes:

None.


Examples:

The following example sets a menu definition string as the source for an existing menu.

var myContextMenuDefinition = "";
myContextMenuDefinition += "item" + "\t" + "0" + "\t" + "1" + "\t" + "Item 1" + "\t" + "" + "\r\n";
myContextMenuDefinition += "item" + "\t" + "0" + "\t" + "2" + "\t" + "Item 2" + "\t" + "disabled" + "\r\n";
myContextMenuDefinition += "item" + "\t" + "0" + "\t" + "3" + "\t" + "Item 3" + "\t" + "checked" + "\r\n";

ssCore.Popup.setMenu({name:"MyContextMenu", resource:myContextMenuDefinition});