I’m trying to add a button to the image series display GUI from ImageView.jl that, when pressed, runs some series of functions. I’ve added the button, but (probably due to some reading comprehension failure) I haven’t managed to hook it up properly: the functions run immediately rather than waiting for the button to be pressed. In the MWE below, the button should remove the annotation point at the center of the image when pressed.
using Images, ImageView, GtkReactive, Gtk.ShortNames
img = Gray.(rand(100,100,10))
guidata = imshow(img, axes=(1,2))
done = button("Done")
push!(guidata["gui"]["vbox"][3], done)
idx = annotate!(guidata, AnnotationPoint(50, 50, shape='.', size=4, color=Gray(1.0)))
showall(guidata["gui"]["window"])
sigdone = map(done) do btn
delete!(guidata, idx)
end