-
-
Notifications
You must be signed in to change notification settings - Fork 10.1k
-
-
Notifications
You must be signed in to change notification settings - Fork 10.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Having trouble understanding how to pre-dock windows. #5778
Comments
Btw, by predocking, I mean docking the scene graph to the left, the content to the bottom, the editor to the right, and the viewport to central node. I've been searching for hours, but to no avail. |
In pseudo code you tried to write should look more like:
(GetWindowDockID() gets the dock node id of the current window which is undefined in your snippet (and likely is the implicit/hidden “Debug” window)) However that api doesn’t allow any form of splitting. |
Also you shouldn’t call SetNextWindowPos/Size along with SetNextWindowDockID(), the earlier two will undock the window. |
Hi, it looks like I am also facing a similar problem with predocking/initial docking. With the code below, it looks like the text in the window cannot be rendered out.
Please let me know if there is anything wrong with my code/usage. I have spent quite a bit of my time on reading previous issues relating to create such a window but it looks like they are too old for the API now.😄 |
Hi, sorry for bothering. It looks like this issue maybe helpful: #4033 In general, the strategy here can be different. Instead of using the BuildDockSplit(), we can just use the .ini format to do the pre-docking. This .ini can be created manually beforehand. E.g. This works for me:
Hopefully this can be helpful. Btw, the .ini file is automatically generated by default by the Dear ImGUI. |
ImGuiID dockspace_id = ImGui::DockSpaceOverViewport(ImGui::GetMainViewport(), ImGuiDockNodeFlags_PassthruCentralNode);
ImGui::DockBuilderRemoveNodeChildNodes(dockspace_id); // clear any previous layout You are killing and recreating the docking setup every frame, preventing any interactions with the docking system. I don't think you can use
I disagree. This is a XY Solution and dead-end, people are misunderstanding and underestimating the details of what it means to have a long term persist layout. Even I haven't cracked the correct model for it (may need to put an emphase on linking new window to an existing window instead of a node, so occasional windows don't have to be setup ahead of time). |
Hi, i don't know if you still need this but here is working code that solves your issue, you only have to init the nodes once
|
Hi,
I am writing an app in C++, and I can't seem to understand how to pre-dock windows. I can drag and dock just fine, but that's all.
Here is a small bit of code,
ImGui::DockSpaceOverViewport(ImGui::GetMainViewport());
which enables docking. I can drag and drop any of my windows properly. But I can't figure out how to make them docked at first. My windows code is quite simple.
`if (!mSGF) {
Can you point me to an example of how to achieve this?
The text was updated successfully, but these errors were encountered: