How can I execute a function when I press a button in Makie?
This is missing in the documentation.
Example:
using GeometryBasics, GLMakie
function reset()
# set camera and zoom to default values
end
function main()
scene, layout = layoutscene(resolution = (800, 900), backgroundcolor = RGBf0(0.7, 0.8, 1))
scene3D = LScene(scene, scenekw = (show_axis=false, limits = Rect(-7,-10.0,0, 11,10,11), resolution = (800, 800), camera = cam3d_cad!, raw = false))
layout[1, 1] = scene3D
layout[2, 1] = buttongrid = GridLayout(tellwidth = false)
buttongrid[1, 1:3] = [Button(scene, label = "RESET"), Button(scene, label = "Zoom +"), Button(scene, label = "Zoom -")]
return scene
end
I want that the function reset() is called when I click the button “RESET”.
Full code available at: https://github.com/ufechner7/KiteViewer