I want to do the following in Makie: press a button which triggers long computation that interactively updates the plot. I can’t seem to figure it out. Here is a MWE:
This example uses the bool observable
running to track whether the long computation is triggered.
F = Figure(resolution=(600,600)) F[1,1] = inputgrid = GridLayout(tellwidth = false) running = Observable(false) b = Button(F, label = @lift(string($running))) inputgrid[1,1] = b on(b.clicks) do _ running = true # this should change the button label from "false" to "true" sleep(1) # this is the long computation running = false # resetting the button label end F
When I press the button, the plot becomes non-responsive for a second and the label does not change. I am expecting the label to change immediately on button press to “true” and then change back to “false” after a second.
What am I doing wrong? Are
notify calls incapable of working when called from withing an
on call? How can I make the button turn to “true” on click and then on its own turn back to “false”?
This is on Julia 1.8.2 and GLMakie v0.7.3.