Search Unity

Gui.ModalWIndow in an EditorWindow throws errors

Discussion in 'Immediate Mode GUI (IMGUI)' started by Jaimi, Jul 30, 2013.

  1. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,208
    When I replace a single "GUI.Window" with a "GUI.ModalWindow" call, all the GUILayout and EditorGUILayout calls *inside* the window functions throw errors (as if I had forgotten and "EndHorizontal"), even though I haven't and it works perfectly when using GUI.Window.

    Is it not possible to use GUI.ModalWindow and draw in it with GUILayout?

    Has anyone got any tips on using GUI.ModalWindow?

    Error text below:

    ArgumentException: Getting control 0's position in a group with only 0 controls when doing mouseDown
    Aborting
    UnityEngine.GUILayoutGroup.GetNext ()
    UnityEngine.GUILayoutUtility.BeginLayoutGroup (UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options, System.Type LayoutType)
    UnityEngine.GUILayout.BeginHorizontal (UnityEngine.GUIContent content, UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options)
    UnityEngine.GUILayout.BeginHorizontal (UnityEngine.GUILayoutOption[] options)
    TerrainGenerator.NodeEditorWindow.DoPropertiesGUI (Int32 ID) (at Assets/TerrainNodeSystem/NodeEditorWindow.cs:203)
    UnityEngine.GUI.CallWindowDelegate (UnityEngine.WindowFunction func, Int32 id, UnityEngine.GUISkin _skin, Int32 forceRect, Single width, Single height, UnityEngine.GUIStyle style)
    UnityEditor.EditorWindow:BeginWindows()
    TerrainGenerator.NodeEditorWindow:OnGUI() (at Assets/TerrainNodeSystem/NodeEditorWindow.cs:309)
    UnityEditor.DockArea:OnGUI()