Skip to content

Commit

Permalink
Merge pull request #97 from IanButterworth/ib/text_fix_179
Browse files Browse the repository at this point in the history
[release-1.79] Workaround Text segfault
  • Loading branch information
Gnimuc authored Sep 25, 2023
2 parents 075d9d4 + e3ee19b commit dfa4e07
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 @@ -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)
Expand Down

0 comments on commit dfa4e07

Please sign in to comment.