I have another problem and am searching for ours.
I just want to create a new EditorWindow called “MyEditorWindow” with a title “MyEditorWindow” and an icon “MyEditorWindow.png”. I try it as following:
void OnEnable()
{
titleContent = new GUIContent("MyEditorWindow",
AssetDatabase.LoadAssetAtPath<Texture>("<path to image>/MyEditorWindow.png"),
"This is a tooltip.");
}
The icon is marked as editor GUI image, but it does only appear, if i move the window. Can anyone help me?
As soon as I posted this thread, I found the solution:
The title is too long and moves the icon to the left, outside of the title bar. But this leads me to another question: Is there a way to edit the length of the title bar, so that the icon AND a long title are displayed properly?