Skip to content

Commit

Permalink
Merge pull request #95 from IanButterworth/ib/workaround_text
Browse files Browse the repository at this point in the history
Workaround Text segfault on MacOS
  • Loading branch information
Gnimuc authored Sep 23, 2023
2 parents 2883aac + e7419f6 commit c4828c8
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(formatted_text)
else
igText(formatted_text)
end
end

"""
TextColored(col, formatted_text)
Expand Down

0 comments on commit c4828c8

Please sign in to comment.