mirror of
https://github.com/ocornut/imgui.git
synced 2026-11-10 19:03:30 +00:00
Column with variable width content not updating scroll area width #2142
Labels
No labels
accidentally closed
android
backends
bug
building
clipper
coloredit
color spaces
cplusplus
data types
demo
disabled
doc
docking
dpi
drag drop
drawing/drawlist
dropped
dx12
enhancement
focus
font/text
gallery
help wanted
idle/power saving
ime
in progress
inputs
inputtext
internals
label/id and id stack
language bindings
layout
linux/bsd
menus
multi-contexts
multi-threading
multi-viewports
nav
news/info
opengl
optimization
osx/ios
overlap
plot/graph
popups
question
scrolling
selection
settings
sliders/drags
style
tables/columns
tabs
test wanted
tools
tooltips
tree
tricks & tips
useful widgets
vulkan
web
window pos/depth
window sizing
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
ocornut/imgui#2142
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Version/Branch of Dear ImGui:
1.65
Back-end file/Renderer/OS:
Back-ends: imgui_impl_sdl.cpp + imgui_impl_dx11.cpp
OS: Windows 7
My Issue/Question:
I want to make a table consisting of two columns, one with variable width, but the scroll area isn't updated according to the width of the columns.
Standalone, minimal, complete and verifiable example:
Screenshots/Video


Use case:
Example code:
Hello @Alan-FGR,
At the moment columns are a container which do not report the size of their contents outside.
That's a legitimate issue but the situation is a little tricky today (TL;DR; Columns are currently terrible and haven't been really improved since 1.00 - need some love).
There's a temporary workaround you can use which restore pre-1.51 bug/behavior of reporting the farther X position of the last column, which happens to be specifically useful in a couple of case including yours. You can use this internal API instead of
Columns().Please note that for simple use and in particular your use here, you are probably better off not using Columns at all, and just using SameLine() to position the cursor after the first call to
Text().Hello @ocornut! Thank you for your reply.
Yes, I've ended up going with just labels and buttons and using SameLine(), it works just as well but there's no vertical separator 😛 what's no big deal... in any case that trick/workaround could come handy I guess, it's always good to have them up my sleeves, but yeah I won't be using columns when I need that kind of behavior. Columns have their uses though, I think especially when you want to allow the user to resize them.
I think this is a legit bug/improvement so I won't close the issue.
PS: 12345 stars is happening 😆
IT HAPPENED!! 🤣

@ocornut congrats man!
Closing this as new tables api has more configurability + support for horizontal scrolling and horizontal freezing.