Comments (8)
How to get resizable child in window?
enum ImGuiChildFlags_
{
ImGuiChildFlags_None = 0,
ImGuiChildFlags_Border = 1 << 0, // Show an outer border and enable WindowPadding. (IMPORTANT: this is always == 1 == true for legacy reason)
ImGuiChildFlags_AlwaysUseWindowPadding = 1 << 1, // Pad with style.WindowPadding even if no border are drawn (no padding by default for non-bordered child windows because it makes more sense)
ImGuiChildFlags_ResizeX = 1 << 2, // Allow resize from right border (layout direction). Enable .ini saving (unless ImGuiWindowFlags_NoSavedSettings passed to window flags)
ImGuiChildFlags_ResizeY = 1 << 3, // Allow resize from bottom border (layout direction). "
ImGuiChildFlags_AutoResizeX = 1 << 4, // Enable auto-resizing width. Read "IMPORTANT: Size measurement" details above.
ImGuiChildFlags_AutoResizeY = 1 << 5, // Enable auto-resizing height. Read "IMPORTANT: Size measurement" details above.
ImGuiChildFlags_AlwaysAutoResize = 1 << 6, // Combined with AutoResizeX/AutoResizeY. Always measure size even when child is hidden, always return true, always disable clipping optimization! NOT RECOMMENDED.
ImGuiChildFlags_FrameStyle = 1 << 7, // Style the child window like a framed item: use FrameBg, FrameRounding, FrameBorderSize, FramePadding instead of ChildBg, ChildRounding, ChildBorderSize, WindowPadding.
};
Use flags: ImGuiChildFlags_ResizeX and ImGuiChildFlags_ResizeY
from imgui.
Use flags: ImGuiChildFlags_ResizeX and ImGuiChildFlags_ResizeY
Just tried: same behavior / problem.
from imgui.
bool open = true;
ImGui::Begin("Viewport", &open);
ImGui::BeginChild("Viewport", { 100,100 }, ImGuiChildFlags_Border| ImGuiChildFlags_ResizeX | ImGuiChildFlags_ResizeY, ImGuiWindowFlags_None);
ImGui::EndChild();
ImGui::End();
Try it. It works for me, guaranteed.
from imgui.
Trying suppressing image and adding border to see child frontiers:
bool open = true;
ImGui::Begin("Viewport", &open);
ImGui::BeginChild("Viewport", size, ImGuiChildFlags_Border | ImGuiChildFlags_ResizeX | ImGuiChildFlags_ResizeY,
// ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_NoScrollWithMouse);
ImGuiWindowFlags_None);
//ImGui::Image(reinterpret_cast<void*>(tex), ImGui::GetContentRegionAvail(), ImVec2(0, 1), ImVec2(1, 0));
ImGui::EndChild();
ImGui::End();
And get:
from imgui.
Your question is ambiguous. The child window in your picture should be user resizable, which is what you have asked for. I donβt understand what you are expecting.
from imgui.
I expected the child borders to stick to the ones of the parent window. I guess I misunderstood the meaning of the resize options.
from imgui.
If you use BeginChild() with the default 0,0 size it will fill all available space. Size=0,0 is the same as using GetContentRegionAvail().
However if you have a window with only a child filling all space inside, then the child window is not necessary.
from imgui.
Closing as answered, let us know if you have another issue.!
from imgui.
Related Issues (20)
- "Getting Started" guide misleading step HOT 1
- Suggestion: Extend demo with full screen window / docking examples HOT 9
- Set default tab in TabBar HOT 1
- Suggestion: Add a TabItem that behaves like a Button HOT 3
- Gallery: Post your screenshots / code here (PART 20) HOT 3
- feat: API for Styling glyphs HOT 3
- Child Window Drawing Order HOT 19
- Changing the style of checkbox HOT 1
- Build error with recent version of dawn HOT 1
- When using MultiSelect with BoxSelect in a Table with ScrollY and BordersOuter, items sometimes get skipped HOT 4
- HoveredWindow state is no longer cleared after closing a secondary viewport HOT 2
- Incorrect set for FontScale in the SetCurrentWindow HOT 1
- Can't type Korean in the text box. HOT 7
- imgui_widgets.cpp gives 200+ errors HOT 1
- How can I size a table correctly for a given number of rows when using ImGuiTableFlags_ScrollX? HOT 4
- Image Loading Not Working
- Item-tooltip for group will disappear for a short time if the widget inside is clicked HOT 1
- Multi-viewport: window constrained to main viewport moves if it goes outside of viewport HOT 2
- Add a flag to disable Ctrl+Tab navigation HOT 1
- Renderer backend for the new SDL3 GPU API HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from imgui.