From 3d7b56a331f9dc81eb05facd6a97f0fec2845580 Mon Sep 17 00:00:00 2001 From: tetenpapier Date: Wed, 10 Aug 2022 19:40:53 +0200 Subject: [PATCH] add pass_filter_end --- imgui/src/widget/text_filter.rs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/imgui/src/widget/text_filter.rs b/imgui/src/widget/text_filter.rs index b123c20..c6be59a 100644 --- a/imgui/src/widget/text_filter.rs +++ b/imgui/src/widget/text_filter.rs @@ -58,8 +58,18 @@ impl TextFilter { } } - pub fn pass_filter_end(_buf: String, _end: String) -> bool { - true + pub fn pass_filter_end(&self, mut start: String, mut end: String) -> bool { + start.push('\0'); + end.push('\0'); + let b_ptr = start.as_mut_ptr(); + let e_ptr = end.as_mut_ptr(); + unsafe { + sys::ImGuiTextFilter_PassFilter( + self.raw, + b_ptr as *mut sys::cty::c_char, + e_ptr as *mut sys::cty::c_char, + ) + } } pub fn clear(&mut self) {