We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Dear ImGui 1.89 WIP (18808) -------------------------------- sizeof(size_t): 8, sizeof(ImDrawIdx): 2, sizeof(ImDrawVert): 20 define: __cplusplus=202002 define: _WIN32 define: _WIN64 define: __MINGW32__ define: __MINGW64__ define: __GNUC__=12 define: IMGUI_HAS_VIEWPORT define: IMGUI_HAS_DOCK -------------------------------- io.BackendPlatformName: imgui_impl_glfw io.BackendRendererName: imgui_impl_opengl3 io.ConfigFlags: 0x00000441 NavEnableKeyboard DockingEnable ViewportsEnable io.ConfigViewportsNoDecoration io.ConfigInputTextCursorBlink io.ConfigWindowsResizeFromEdges io.ConfigMemoryCompactTimer = 60.0 io.BackendFlags: 0x00001C0E HasMouseCursors HasSetMousePos PlatformHasViewports HasMouseHoveredViewport RendererHasVtxOffset RendererHasViewports -------------------------------- io.Fonts: 1 fonts, Flags: 0x00000000, TexSize: 512,128 io.DisplaySize: 800.00,600.00 io.DisplayFramebufferScale: 1.00,1.00 -------------------------------- style.WindowPadding: 8.00,8.00 style.WindowBorderSize: 1.00 style.FramePadding: 4.00,3.00 style.FrameRounding: 0.00 style.FrameBorderSize: 0.00 style.ItemSpacing: 8.00,4.00 style.ItemInnerSpacing: 4.00,4.00
Version/Branch of Dear ImGui:
Version: 1.89 Branch: Docking
Back-end/Renderer/Compiler/OS
Back-ends: imgui_impl_opengl3.cpp + imgui_impl_glfw.cpp Compiler: GCC 12.1 Operating System: Windows 10
My Issue/Question:
I'm trying to place a selectable and a small button on the same line, but only the first button works and the others don't.
The problem doesn't seem to be the ListBox, given that when I try whithout it, the second up to the last button don't work.
I tried looking for this issue, but couldn't find it anywhere, is there a solution?
Screenshots/Video
Standalone, minimal, complete and verifiable example: (see #2261)
ImGui::Begin("Viewport"); { static const char* items[] = {"0", "1", "2", "3", "4", "5"}; static int selectedIdx = -1; if(ImGui::BeginListBox("##listbox", ImVec2(-FLT_MIN, ImGui::GetContentRegionAvail().y * 0.5f))) { for(int i = 0; i < 6; ++i) { bool bIsSelected = (selectedIdx == i); if(ImGui::Selectable(items[i], bIsSelected, ImGuiSelectableFlags_AllowItemOverlap)) { if(bIsSelected) // Clicking on the same object twice to deselect selectedIdx = -1; else selectedIdx = i; } ImGui::SameLine(); if(ImGui::SmallButton("delete")) { printf("Index of item to be deleted = %i\n", i); } } ImGui::EndListBox(); } } ImGui::End();
The text was updated successfully, but these errors were encountered:
You have an ID collection and likely you use PushID(i) in your loop to make the ID on each line unique. See FAQ https://github.com/ocornut/imgui/blob/master/docs/FAQ.md#q-about-the-id-stack-system
PushID(i)
Sorry, something went wrong.
Oh man, thanks. The problem wasn't apparent to me at first, now I see.
Added io.ConfigDebugHighlightIdConflicts debug feature! (#7961, #7669)
67cd4ea
Also #74, #96, #480, #501, #647, #654, #719, #843, #894, #1057, #1173, #1390, #1414, #1556, #1768, #2041, #2116, #2330, #2475, #2562, #2667, #2807, #2885, #3102, #3375, #3526, #3964, #4008, #4070, #4158, #4172, #4199, #4375, #4395, #4471, #4548, #4612, #4631, #4657, #4796, #5210, #5303, #5360, #5393, #5533, #5692, #5707, #5729, #5773, #5787, #5884, #6046, #6093, #6186, #6223, #6364, #6387, #6567, #6692, #6724, #6939, #6984, #7246, #7270, #7375, #7421, #7434, #7472, #7581, #7724, #7926, #7937 and probably more.. Tagging to increase visibility!
No branches or pull requests
Version/Branch of Dear ImGui:
Version: 1.89
Branch: Docking
Back-end/Renderer/Compiler/OS
Back-ends: imgui_impl_opengl3.cpp + imgui_impl_glfw.cpp
Compiler: GCC 12.1
Operating System: Windows 10
My Issue/Question:
I'm trying to place a selectable and a small button on the same line, but only the first button works and the others don't.
The problem doesn't seem to be the ListBox, given that when I try whithout it, the second up to the last button don't work.
I tried looking for this issue, but couldn't find it anywhere, is there a solution?
Screenshots/Video
Standalone, minimal, complete and verifiable example: (see #2261)
The text was updated successfully, but these errors were encountered: