MATLAB Function Reference
  Go to function:
    Search    Help Desk 
uicontextmenu    Examples   See Also

Create a context menu

Syntax

Description

uicontextmenu creates a context menu, which is a menu that is accessed when the user right-clicks on the graphics object associated with the menu. On a Macintosh, perform a right-click using a Ctrl-click.

You create context menu items using the uimenu function. Menu items appear in the order the uimenu statements appear. You associate a context menu with an object using the UIContextMenu property for the object and specifying the context menu's handle as the property value.

More information about context menus.

Properties

This table lists all uicontextmenu properties, grouping them by function. Each property name acts as a link to a description of the property.

Property Name
Property Description
Property Value
Controlling Style and Appearance
Clipping
This property has no effect on Uicontextmenu objects

SelectionHighlight
This property has no effect on Uicontextmenu objects

Visible
Uicontextmenu visibility
Value: on, off
Default: on
General Information About the Object
Children
The Uimenus defined for the Uicontextmenu
Value: matrix
Parent
Uicontextmenu object's parent
Value: scalar Figure handle
Selected
This property has no effect on Uicontextmenu objects

Tag
User-specified object identifier
Value: string
Type
Class of graphics object
Value: string (read-only)
Default: uicontrol
UserData
User-specified data
Value: matrix
Controlling Callback Routine Execution
BusyAction
Callback routine interruption
Value: cancel, queue
Default: queue
ButtonDownFcn
This property has no effect on Uicontextmenu objects

Callback
Control action
Value: string
CreateFcn
Callback routine executed during object creation
Value: string
DeleteFcn
Callback routine executed during object deletion
Value: string
Interruptible
Callback routine interruption mode
Value: on, off
Default: on
UIContextMenu
This property has no effect on Uicontextmenu objects

Controlling Access to Objects
HandleVisibility
Whether handle is accessible from command line and GUIs
Value: on, callback, off
Default: on
HitTest
This property has no effect on Uicontextmenu objects

Example

These statements define a context menu associated with a line. When the user extend-clicks anywhere on the line, the menu appears. Menu items enable the user to change the line style.

When the user extend-clicks on the line, the context menu appears, as shown in this figure:


Object Hierarchy

See Also

uicontrol, uimenu



[ Previous | Help Desk | Next ]