From e3ee19b0cc0ef884fdec84113b6e9e250439f6c4 Mon Sep 17 00:00:00 2001 From: Ian Butterworth Date: Fri, 22 Sep 2023 22:35:30 -0400 Subject: [PATCH] workaround Text segfault --- src/wrapper.jl | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/wrapper.jl b/src/wrapper.jl index d3e4948..0cc3e78 100644 --- a/src/wrapper.jl +++ b/src/wrapper.jl @@ -1027,7 +1027,15 @@ Create a text widget. Formatting is not supported which means you need to pass a formatted string to this function. It's recommended to use Julia stdlib `Printf`'s `@sprintf` as a workaround when translating C/C++ code to Julia. """ -Text(formatted_text) = igText(formatted_text) +function Text(formatted_text) + @static if Sys.isapple() + # Workaround for segfault on MacOS + # TODO: Fix https://github.com/Gnimuc/CImGui.jl/issues/74 + TextUnformatted(formatted_text) + else + igText(formatted_text) + end +end """ TextColored(col, formatted_text)