Poptart.jl
Poptart.jl copied to clipboard
fix "DivideError" when initalising InputText. fixes #23
I didn't try to compile this PR locally, instead I tested it by modifying the file directly in ~/.julia/packages/Poptart/RbjXy/src/Desktop/imgui_controls.jl
and then applying the same change to this PR.
then I copied the example from the readme and was pleased to see that it works
using Poptart.Desktop # Application Window InputText Button didClick
window1 = Window()
app = Application(windows = [window1])
input1 = InputText(label="Subject", buf="")
button1 = Button(title = "submit")
push!(window1.items, input1, button1)
didClick(button1) do event
@info :didClick (event, input1.buf)
end
Desktop.exit_on_esc() = true
!isinteractive() && wait(app.closenotify)
thanks for the PR!
I have investigated it and I found the changes in the rpad
function since julia 1.7
https://github.com/JuliaLang/julia/blob/master/base/strings/util.jl#L464
I will make another commit to fix the #23
Thanks.
you could test #23 with master branch.
using Pkg
pkg"dev CImGui" # CImGui 1.82.0
pkg"dev Poptart" # Poptart 0.4.0
thanks.