Navigation

Operators and Keywords

Function List:

C++ API

: hui = uicontextmenu (property, value, …)
: hui = uicontextmenu (h, property, value, …)

Create a uicontextmenu object and return a handle to it.

If h is omitted then a uicontextmenu for the current figure is created. If no figure is available, a new figure is created first.

If h is given then a uicontextmenu relative to h is created.

Any provided property value pairs will override the default values of the created uicontextmenu object.

Uicontextmenu properties are documented at ‘Uicontextmenu Properties’.

Examples:

% create figure and uicontextmenu
f = figure;
c = uicontextmenu (f);

% create menus in the context menu
m1 = uimenu ("parent",c,"label","Menu item 1","callback","disp('menu item 1')");
m2 = uimenu ("parent",c,"label","Menu item 2","callback","disp('menu item 2')");

% set the context menu for the figure
set (f, "uicontextmenu", c);

See also: figure, uimenu.

Package: octave