summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2014-10-27 18:03:33 -0400
committerJesse Luehrs <doy@tozt.net>2014-10-27 18:03:33 -0400
commit282510bf2368b710fa3b37aa988960e58571620f (patch)
tree4215d0b5aa9131301964df56c0eba180aeb16001
parent0b4ae682dbac609d5e57dc7989b2d0ba99a9dd32 (diff)
downloadjulia-fractals-282510bf2368b710fa3b37aa988960e58571620f.tar.gz
julia-fractals-282510bf2368b710fa3b37aa988960e58571620f.zip
allow double-click to redraw
-rw-r--r--src/renderer.jl5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/renderer.jl b/src/renderer.jl
index 9ebdc96..26f5b3d 100644
--- a/src/renderer.jl
+++ b/src/renderer.jl
@@ -23,6 +23,7 @@ type FractalCanvas
ImageView.rerender(imgc, img2)
ImageView.resize(imgc, img2)
end
+ bind(c, "<Double-Button-1>", (path,x,y)->fractal(c, make_c, step, false))
return fc
end
end
@@ -39,7 +40,7 @@ end
fractal(make_c, step) = fractal(createwindow(), make_c, step)
fractal(fc::FractalCanvas, make_c, step) = fractal(fc.c, make_c, step)
-function fractal(canvas::Canvas, make_c::Function, step::Function)
+function fractal(canvas::Canvas, make_c::Function, step::Function, should_wait=!isinteractive())
fc = FractalCanvas(canvas, make_c, step)
i = 0
@@ -54,7 +55,7 @@ function fractal(canvas::Canvas, make_c::Function, step::Function)
end
end
- if (!isinteractive())
+ if should_wait
cv = Condition()
win = Tk.toplevel(fc.c)
bind(win, "<Destroy>", e->notify(cv))