Here is a code snippet for the problem that I am having:
using GLMakie,Colors,GeometryBasics
fig = Figure(resolution = (1920, 1080))
plot_scene = LScene(fig[1,1], scenekw=(camera = old_cam3d!,show_axis = false),tellwidth = true)
plot_scene.scene.clear=true
plot_scene.scene.center[] = false
slider = Slider(fig[2,1],range=0.0:0.01:10.0, startvalue = 0.0,tellwidth = false,tellhight = true)
x = Node([0.0])
lift(slider.value) do val
x[] = [val]
end
scatter!(plot_scene.scene,x,[0.0],[0.0],color =:black,markersize=300.0)
#delete!(slider)
display(fig)
Changing the value of the slider changes the position of a scatter point, to visualize that the slider is working.
What I want to do now, is to delete/remove the slider (and ideally add it again later).
The best thing I could find was delete!(slider)
. However, this just seems to remove the “visual part” of the slider, not the “interactive part”. Meaning, you can drag the mouse over the area where the slider used to be and still move the scatter point, even thought the slider is not visible anymore.
Furthermore, adding the slider back in by using slider = Slider(fig[2,1],range=0.0:0.01:10.0, startvalue = 0.0,tellwidth = false,tellhight = true)
makes a slider visible again, but the slider point does not move when dragging it.
Naively, I think that I should be able to solve this by removing/clearing the GridPosition the slider is assigned to. But I could not find documentation of a function that does this.
Any ideas on how to solve this are greatly appreciated.