# DisplayDialogComplex(string, string, string, string, string)

> Displays a modal dialog with three buttons.

## Definition

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

```csharp
public static int DisplayDialogComplex(string title, string message, string ok, string cancel, string alt)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): The title of the dialog box. If left null, defaults to "Unity".**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): Purpose for the dialog.**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): Dialog function chosen.**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): Close dialog with no operation.**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): Choose alternative dialog purpose.

### Returns

| Type                                                       | Description                                                                                                                                                                                                                             |
| ---------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | Returns the ID of a button. IDs are 0, 1, or 2 and they correspond to the `ok`, `cancel` and `alt` buttons respectively. An ID of 1, which corresponds to `cancel`, returns if the dialog is closed or the user presses the Escape key. |

### Remarks

Use it for displaying message boxes in the Editor. If `message` is null or whitespace, an `ArgumentNullException` is thrown. If `messageText` is longer than 512 characters, it is truncated and the full message is logged to the console in markdown format.

DisplayDialogComplex is similar to [EditorUtility.DisplayDialog](/engine/6000.7/script-reference/unityeditor/editorutility/displaydialog.md). This `DisplayDialogComplex` member shows a dialog with three buttons. These buttons represent `ok`, `cancel` and `alt`. DisplayDialogComplex returns an integer 0, 1 or 2 corresponding to the `ok`, `cancel` and `alt` buttons.

The `ok` button is the default option, and can also be activated by pressing Enter.

The `cancel` button is considered the "cancel" button and should usually not perform any action. On a PC, this can also be activated by pressing Escape or by clicking the dialog window close button. On a Mac, this can also be activated by pressing Escape, provided the button is called "Cancel".

The `alt` button allows you to provide the user with an alternative choice in addition to the `ok` and `cancel` buttons. This button does not have a fixed keyboard shortcut.

If any button's text is longer than 64 characters, an `ArgumentException` is thrown.

On macOS, the orientation of the buttons may be horizontal or vertical depending on the length of the message. Additionally, if the layout is horizontal, the button layout is different from Windows or Linux, with the default button on the right and the alternate button on the far left.

**Note:** `EditorUtility.DisplayDialog` and `EditorUtility.DisplayDialogComplex` are kept for backwards compatibilty. For new code, it is strongly recommended to use one of the new [EditorDialog](/engine/6000.7/script-reference/unityeditor/editordialog.md) methods.

Additional Resources:

* [EditorDialog.DisplayAlertDialog](/engine/6000.7/script-reference/unityeditor/editordialog/displayalertdialog.md)
* [EditorDialog.DisplayAlertDialogWithOptOut](/engine/6000.7/script-reference/unityeditor/editordialog/displayalertdialogwithoptout.md)
* [EditorDialog.DisplayDecisionDialog](/engine/6000.7/script-reference/unityeditor/editordialog/displaydecisiondialog.md)
* [EditorDialog.DisplayDecisionDialogWithOptOut](/engine/6000.7/script-reference/unityeditor/editordialog/displaydecisiondialogwithoptout.md)
* [EditorDialog.DisplayComplexDecisionDialog](/engine/6000.7/script-reference/unityeditor/editordialog/displaycomplexdecisiondialog.md)
* [EditorDialog.DisplayComplexDecisionDialogWithOptOut](/engine/6000.7/script-reference/unityeditor/editordialog/displaycomplexdecisiondialogwithoptout.md)

![EditorUtilityDisplayDialogComplex osx (DisplayDialogComplex(string, string, string, string, string))](/api/media?file=/engine/6000.7/media/images/EditorUtilityDisplayDialogComplex-osx.png)

// UPDATE

*macOS display dialog buttons for the example below.*

![EditorUtilityDisplayDialogComplex pc (DisplayDialogComplex(string, string, string, string, string))](/api/media?file=/engine/6000.7/media/images/EditorUtilityDisplayDialogComplex-pc.png)

// UPDATE

*PC display dialog buttons for the example below.*
