During the development of Dear ImGui Bundle, I applied a series of patches to imgui-node-editor and imgui, to make their integration smoother. Since they require modifications on both imgui and imgui-node-editor, proposing a PR is not straightforward.
However, since they might be useful, I took the time to group them here in this issue, in the hope of being helpful.
Thanks to this patch, ImGui::SeparatorText(), ImGui::Separator(), and ImGui::CollapsingHeader() can use the actual node width. It was proposed here
Handle Popups:
@lukaasm proposed a patch here, which solves many issues with popups in the node editor (by automatically suspending the canvas, and placing popups correctly).
By default InputTextMultiline uses a child window, which is not compatible with the node editor.
An additional patch adapts its behavior, by showing a preview within a single line text input,
followed by a "..." button which triggers a popup with the full text edition.
To apply this, two patches are required:
inside imgui-node-editor: A patch on top of @lukaasm's patch:
we need to handle the "depth" of call to ImGui::Begin/End (only the first call should trigger):
it is available here
inside imgui: A patch for InputTextMultiline is available here
Hello @thedmd,
Many thanks for your wonderful library!
During the development of Dear ImGui Bundle, I applied a series of patches to imgui-node-editor and imgui, to make their integration smoother. Since they require modifications on both imgui and imgui-node-editor, proposing a PR is not straightforward.
However, since they might be useful, I took the time to group them here in this issue, in the hope of being helpful.
Demo
Video demo:
https://github.com/user-attachments/assets/6f3f783b-88d4-43ee-b9ef-673b3c8c94aa
You can also test it live on this webasm demo
Handle node width in separators:
Thanks to this patch,
ImGui::SeparatorText()
,ImGui::Separator()
, andImGui::CollapsingHeader()
can use the actual node width. It was proposed hereHandle Popups:
@lukaasm proposed a patch here, which solves many issues with popups in the node editor (by automatically suspending the canvas, and placing popups correctly).
Example implementation for this patch:
With this patch,
ImGui::ColorEdit
,ImGui::Begin/EndCombo
will work correctly inside a node.Warn users if using BeginChild / EndChild:
imgui-node-editor remains incompatible with
ImGui::BeginChild()
andImGui::EndChild()
.Below is the list of ImGui widgets which are concerned (because they use BeginChild/EndChild):
We can warn the developer whenever they use these functions inside a node:
Handle InputTextMultiline
By default
InputTextMultiline
uses a child window, which is not compatible with the node editor. An additional patch adapts its behavior, by showing a preview within a single line text input, followed by a "..." button which triggers a popup with the full text edition.To apply this, two patches are required: