# DisplayPopupMenu(Rect, string, MenuCommand)

> Displays a popup menu.

## Definition

* **Type:** Method
* **Namespace:** [UnityEditor](/engine/6000.6/script-reference/unityeditor.md)
* **Assembly:** UnityEditor.CoreModule

```csharp
public static void DisplayPopupMenu(Rect position, string menuItemPath, MenuCommand command)
```

### Parameters

**** (\[Rect]\(/engine/6000.6/script-reference/unityengine/rect)): **** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): **** (\[MenuCommand]\(/engine/6000.6/script-reference/unityeditor/menucommand)):&#x20;

### Remarks

Menu is shown at position `pos`, generated from a submenu specified by `menuItemPath` using a [MenuCommand](/engine/6000.6/script-reference/unityeditor/menucommand.md) as menu context.

### Examples

```csharp
using UnityEditor;
using UnityEngine;
using System.Collections;

// Shows the Assets menu when you right click on the contextRect Rectangle.
public class EditorUtilityDisplayPopupMenu : MonoBehaviour
{
    void OnGUI()
    {
        Event evt = Event.current;
        Rect contextRect = new Rect(10, 10, 100, 100);
        if (evt.type == EventType.ContextClick)
        {
            Vector2 mousePos = evt.mousePosition;
            if (contextRect.Contains(mousePos))
            {
                EditorUtility.DisplayPopupMenu(new Rect(mousePos.x, mousePos.y, 0, 0), "Assets/", null);
                evt.Use();
            }
        }
    }
}
```
