wookay / Poptart.jl

🏂 GUI programming in Julia based on CImGui.jl
46 stars 6 forks source link

fix "DivideError" when initalising InputText. fixes #23 #24

Open bjuergens opened 2 years ago

bjuergens commented 2 years ago

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)
wookay commented 2 years ago

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.

wookay commented 2 years ago

you could test #23 with master branch.

using Pkg
pkg"dev CImGui"     # CImGui  1.82.0
pkg"dev Poptart"    # Poptart 0.4.0

thanks.