mirror of
https://github.com/ocornut/imgui.git
synced 2026-11-16 19:11:13 +00:00
CountGrep/Filters.Size always returns 1 #3906
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#3906
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:
Version: 1.81 WIP
Branch: master
Back-end/Renderer/Compiler/OS
Back-ends: imgui_impl_opengl2.cpp + imgui_impl_glfw.cpp
Compiler: Clang
Operating System: Manjaro Linux x86_64
My Issue/Question:
I'm using the ImGuiTextFilter API (followed the one in the imgui_demo.cpp) for my CommandPalette UI.
The rendering code is as follow:
The filtering works, when I type
p, i get the 3 results.I've tried printing the value of
filter.CountGrepafter thefilter.Draw()and after thefilter.PassFilter()but the value is always1regardless of the number of items filtered (value is 0 of course when there is no text input in the filter box).I've tried also printing
filter.Filters.Sizebut same behavior asCountGrep.I believe
CountGrepis incremented many times as I've seen in the source codeimgui.cppWhat problem are you trying to solve?
CountGrepis an internal flag, you are not meant to read that flag. If you check all examples use of this helper all you are supposed to do is to callPassFilter().Oh that's for internal use. Pardon for that.
I'm trying to get all the count of the items resulted by the text filter.
You are calling the filter and it returns true when an item passes. So you can infer that count if you need it.