Editor Nightmare!

I’m trying to create a custom editor, but forwhatever reason, the functions aren’t displaying. What am I doing wrong??

using UnityEngine;
using UnityEditor;

public class TestEditor : EditorWindow
{
	
	//TestDatabase tdb;
	bool ShowNewItemDetails=false;

	const string DATABASE_PATH = @"Assets/" +DATABASE_FOLDER_NAME + "/" + DATABASE_FILE_NAME;
	const string DATABASE_FOLDER_NAME=@"Databases";
	const string DATABASE_FILE_NAME=@"TestDatabase.asset";
	
	[MenuItem ("True Calling Tools/Test Database")]
	static void TestDatabase() 
	{
		
		TestEditor window = (TestEditor)EditorWindow.GetWindow (typeof (TestEditor));
		window.minSize= new Vector2(400,300);
		window.titleContent.text="Test Database";
		
	}

	enum DisplayState
	{
		NONE,
		GENERALDETAILS,
		WEAPONDETAILS
	};

	DisplayState state=DisplayState.NONE;


	void MakeGeneralItem()
	{
		state=DisplayState.GENERALDETAILS;
		GUILayout.Label("Make me a General item");


	}


	void GeneralTab()
	{
		if(GUILayout.Button("General Items"))
		{
			ShowNewItemDetails=true;
			DetailView();
		}
	}
	
	void OnGUI()
	{
		//just call all the functions
		TopBar();
		EditorGUILayout.BeginHorizontal();
		ListView();
		//DetailView();
		EditorGUILayout.EndHorizontal();
		BottomBar();
	}


	void TopBar()
	{
		GUILayout.BeginHorizontal("Box", GUILayout.ExpandWidth(true));
		GeneralTab();
//		GUILayout.Button("Melee Weapons");
//		GUILayout.Button("Missile Weapons");
//		GUILayout.Button("Armor");
//		GUILayout.Button("Consumable");
//		GUILayout.Button("Jewelry");
//		GUILayout.Button("Packs");
//		GUILayout.Button("Tomes");
		GUILayout.EndHorizontal();

	}

	void BottomBar()
	{
		GUILayout.Label("This is the bottom bar");
	}

	void ListView()
	{
		EditorGUILayout.BeginVertical("Box", GUILayout.Width(200), GUILayout.ExpandHeight(true));
		GUILayout.Label("Give us the list");
		EditorGUILayout.EndVertical();
	}

	void DetailView()
	{

		GUILayout.BeginHorizontal("Box", GUILayout.ExpandWidth(true));
		GUILayout.BeginVertical(GUILayout.ExpandHeight(true));
		GUILayout.Label("State: " + state);
		GUILayout.Label("Details, I want details.");
		switch(state)
		{
		case DisplayState.GENERALDETAILS:
			if(ShowNewItemDetails)
				MakeGeneralItem();
			break;
		default:
			break;
		}
		GUILayout.EndHorizontal();
		GUILayout.EndVertical();
	}



}

It’s supposed to let you click on the general item tab and show the form for that new item. The function is getting called, but nothing is displaying. Thanks for the help!

The window does show the form. Problem is, you are only calling the form showing function once, so it is once drawn for one frame (if at all). In OnGUI, check if the showForm bool is true, and if yes, call the Show Form function. This will make OnGUI draw the form continuously. If you want to hide the form again, just set the bool to false again.

void OnGUI()
     {
         //just call all the functions
         TopBar();
         EditorGUILayout.BeginHorizontal();
         ListView();
         if(ShowNewItemDetails == true) {
              DetailView();
         }
         EditorGUILayout.EndHorizontal();
         BottomBar();
         
     }