mirror of
https://github.com/ocornut/imgui.git
synced 2026-11-14 19:04:44 +00:00
How to increase length of Combo dropdown window #6130
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#6130
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?
Is there a way to make the window length arbitrarily large?
There are flags to BeginCombo() to configure the height to preset values, and you can also call SetNextWindowSize() prior to BeginCombo() to set an explicit height.
Thanks for the quick response. Unfortunately, the SetNextWindowSize is not having any affect. I am using a lua binding, and my code looks roughly like this:
local dropdownSize = #items*GUI:GetFrameHeight()
GUI:SetNextWindowSize(0.0,dropdownSize,GUI.SetCond_Always)
if GUI:BeginCombo(label,selectedItem,flags) then
for i = 1,#items do
local item = tostring(items[i])
local isSelected = (item == selectedItem)
if GUI:Selectable(item,isSelected) then
if not isSelected then
newItem = item
changed = true
end
end
end
GUI:EndCombo()
end
I've verified the size is getting calculated correctly, but the combobox window remains at the default size. Let me know if I am misunderstanding this.
Thanks,
Mike
On 1/30/2023 4:17:06 PM, omar @.> wrote:
There are flags to BeginCombo() to configure the height to preset values, and you can also call SetNextWindowSize() prior to BeginCombo() to set an explicit height.
—
Reply to this email directly, view it on GitHub [https://github.com/ocornut/imgui/issues/6130#issuecomment-1409352340], or unsubscribe [https://github.com/notifications/unsubscribe-auth/ACCGWJA5VCUK2BWDB4RFGW3WVAVVDANCNFSM6AAAAAAULS6AJY].
You are receiving this because you authored the thread.Message ID: @.>
FYI, I am constrained to using version 1.63, if that matters.
That explains why it doesn’t work. You can still use the flags to set policies assuming they were available in 1.63.
You should update because 1.63 is brutally ancient in Dear ImGui terms.
Yeah, I think the flags are available. And I can't upgrade, as much as I would like to - it's in an embedded product over which I have no control. So just to be clear - in v1.63, there is no way to make the dropdown as long as the number of items it contains (beyond what the flags allow, at least), correct?
On 1/30/2023 6:49:52 PM, omar @.> wrote:
That explains why it doesn’t work. You can still use the flags to set policies assuming they were available in 1.63.
You should update because 1.63 is brutally ancient in Dear ImGui terms.
—
Reply to this email directly, view it on GitHub [https://github.com/ocornut/imgui/issues/6130#issuecomment-1409533389], or unsubscribe [https://github.com/notifications/unsubscribe-auth/ACCGWJC4YUWWZVADTYZM4PTWVBHR7ANCNFSM6AAAAAAULS6AJY].
You are receiving this because you authored the thread.Message ID: @.>
I don't know, I can't be looking at solving problems for a 4.5 years old version.
But the flags e.g.
ImGuiComboFlags_HeightLargestare available since 1.53.FYI I was wrong here:
BeginCombo() supported
SetNextWindowSizeConstraints()but notSetNextWindowSize(), until newly pushedf14288708.Yep, I understand. Thanks for getting back to me anyway. You can close this one again.
On 1/31/2023 5:25:32 AM, omar @.> wrote:
So just to be clear - in v1.63, there is no way to make the dropdown as long as the number of items it contains (beyond what the flags allow, at least), correct?
I don't know, I can't be looking at solving problems for a 4.5 years old version.
But the flags e.g. ImGuiComboFlags_HeightLargest are available since 1.53.
and you can also call SetNextWindowSize() prior to BeginCombo() to set an explicit height.
FYI I was wrong here:
BeginCombo() supported SetNextWindowSizeConstraints() but not SetNextWindowSize(), until newly pushed
f142887[ocornut/imgui@f142887088].—
Reply to this email directly, view it on GitHub [https://github.com/ocornut/imgui/issues/6130#issuecomment-1410107869], or unsubscribe [https://github.com/notifications/unsubscribe-auth/ACCGWJBQQ53TIN4OD4N6VLLWVDSBXANCNFSM6AAAAAAULS6AJY].
You are receiving this because you authored the thread.Message ID: @.>