EnumPopup problem (C#)

I am trying to use a custom created enum into an editor script and i have a problem with the resulted popup not updating the value of the field in inspector. The structure is like this:

[System.Serializable]
public enum ItemType
{
    none,
    itemtype1,
    itemtype2
}

// and in the editor class for this type i have
items.itemType = (ItemType)EditorGUILayout.EnumPopup("Item Type", ItemType.none);

Is there anything else to setup for the popup to work?

enum is like type, you must instantiate variable of type “ItemType” :

public enum ItemType { none, itemtype1, itemtype2 }

private ItemType m_myItemType = ItemType.none;

m_myItemType = (ItemType)EditorGUILayout.EnumPopup("Item Type", m_myItemType );

enjoy’

I see now what is my error :), i assumed second parameter in EditorGUILayout.EnumPopup function to be the default value in enum, while that is his value actually. Thx,