Legacy Documentation: Version 5.4
LanguageEnglish
  • C#
  • JS

Script language

Select your preferred scripting language. All code snippets will be displayed in this language.

EditorWindow.ShowPopup

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Sumbission failed

For some reason your suggested change could not be submitted. Please try again in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

public function ShowPopup(): void;
public void ShowPopup();

Description

Shows an Editor window using popup-style framing.

This means the window has no frame, and is not draggable. It is intended for showing something like a popup menu within an existing window.



Opening a window using this method will not give it the functionality of a popup window, only the styling. For full popup functionality (eg, auto closing when the window loses focus), use PopupWindow.

no example available in JavaScript
using UnityEngine;
using UnityEditor;

public class ShowPopupExample : EditorWindow { [MenuItem("Example/ShowPopup Example")] static void Init() { ShowPopupExample window = ScriptableObject.CreateInstance<ShowPopupExample>(); window.position = new Rect(Screen.width / 2, Screen.height / 2, 250, 150); window.ShowPopup(); }

void OnGUI() { EditorGUILayout.LabelField("This is an example of EditorWindow.ShowPopup",EditorStyles.wordWrappedLabel); GUILayout.Space(70); if (GUILayout.Button("Agree!")) this.Close(); } }