Skip to content

Commit

Permalink
workaround Text segfault
Browse files Browse the repository at this point in the history
  • Loading branch information
IanButterworth committed Sep 23, 2023
1 parent 2883aac commit cf47977
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/wrapper.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1029,7 +1029,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(text)
else
igText(formatted_text)
end
end

"""
TextColored(col, formatted_text)
Expand Down

0 comments on commit cf47977

Please sign in to comment.