Poptart.jl icon indicating copy to clipboard operation
Poptart.jl copied to clipboard

fix "DivideError" when initalising InputText. fixes #23

Open bjuergens opened this issue 2 years ago • 3 comments

bjuergens avatar May 07 '22 07:05 bjuergens

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)

bjuergens avatar May 07 '22 07:05 bjuergens

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 avatar May 07 '22 11:05 wookay

you could test #23 with master branch.

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

thanks.

wookay avatar May 07 '22 12:05 wookay