Consider the case where you have many e.g. TextFields across many cells which set the parameters for some long computation. You want the user to be able to set all the parameters and not have the long calculation trigger until they click a button.
confirm is kind of this idea, but you wouldn’t want a confirm for every TextField, and the calculation would trigger each time you clicked the confirm button anyway. Also: there are enough parameters that wrapping everything in a confirm would be combersome.
A checkbox solves this: one can do @bind trigger CheckBox(default = false) and then have the long computation be something like result = trigger ? my_calculation() : nothing in some other cell, and then have other cells that depend on result contain things like if result !== nothing and so on.
The issue you have to check and uncheck the box to regain the ability to edit without triggering the computation, which is kind of unintuitive - it just feels like there has to be a better way.
Ah, you’re right, I think I misunderstood how Button works. For some reason I thought it was adding some kind of dependency blocker that only releases on a button press, but it looks more like the opposite: it just adds another dependency that can be artificially “updated” with a button press.
I don’t have a ton of experience with PlutoUI, so my only other immediate idea would be something like what you’ve already described, like a “Ready?” checkbox and a conditional execution of the code.
Depending on what you’re trying to achieve, it looks like Makie.jl implements some UI elements that you might be able to integrate into Pluto.jl using the WGLMakie.jl backend.
And the values are only updated once you press the button “GO!”
As a bonus, you could wrap this whole thing in a <div> with fixed position, so you don’t need to scroll around in your notebook to find all the parameters.
Example:
Thank you, this is exactly what I needed and so I am going to mark this as the solution to my question as written. I take the confirm solution proposed by yourself and @abraemer seriously though and I will see if I can implement that in a nice way since I agree that it’s preferable.
I have to say this is very cool. One thing though is that I had to separate the interface from the div to get it to display properly: