- Home /
How do I open editor windows using internal methods?
Opening an editor window as a tab is easy with GetWindow but it won't allow opening multiple Windows of the same type. Which is what I need.
I am able to get around the issue by creating a new scriptable object instance of the window but I can't find a way to dock it next to an existing tab this way.
Is there another way to do this? By inspecting the source code of EditorWindow.cs I can see the methods used to specify desiredDockNextTo but they are internal methods and my "reflection-fu" = null
Thank you for reading. Fred.
Answer by KingRecycle · Mar 30, 2019 at 03:06 PM
I think you want EditorWindow.CreateInstance
Thank you for the suggestion but this is already what I do. That method is derived from scriptable objects and doesn't provide a way to set the desiredDockNextTo parameter. Which is what I need.
Answer by Bunny83 · Mar 31, 2019 at 02:10 AM
There's a GetWindow variant that takes that "desiredDockNextTo" parameter array. Though this only provides some rudimentary docking capabilities. To have full control over the docking you would need access to the internal classes (SplitView and others). Some time ago i thought about creating some wrappers for those to be able to arrange tabs the way i want. Though that's quite a bit of work and in most cases not worth it.
Thank you for pitching in. I allready have a solution for docking windows above, bellow or on the left and right of a window. I'm trying to open a new window with its tab behind (or in line with) an existing one, in the same dock area. Just like in google chrome when you hit "ctrl-t" to open a new tab. It will indeed require the use of internal methods.
Your answer
Follow this Question
Related Questions
A smarter Way to get the Type of SerializedProperty 6 Answers
MethodInfo.Invoke() throwing ArgumentException: failed to convert parameters 1 Answer
Where do methods mocked with [WrapperlessIcall] [MethodImpl(MethodImplOptions.InternalCall)] end up? 1 Answer
How to have two inspectors of different types thats objects they are inspecting change 0 Answers