Skip to content

Commit

Permalink
Merge pull request #162 from JuliaImages/teh/preserve
Browse files Browse the repository at this point in the history
Preserve signals until window is destroyed
  • Loading branch information
timholy authored Dec 12, 2018
2 parents a29014e + 4da6fe8 commit fa205f4
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/ImageView.jl
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,11 @@ function imshow(img::AbstractArray, clim,
roidict = imshow(guidict["frame"], guidict["canvas"], img,
wrap_signal(clim), zr, sd, anns)

Gtk.showall(guidict["window"])
Dict("gui"=>guidict, "clim"=>clim, "roi"=>roidict, "annotations"=>anns)
win = guidict["window"]
Gtk.showall(win)
dct = Dict("gui"=>guidict, "clim"=>clim, "roi"=>roidict, "annotations"=>anns)
GtkReactive.gc_preserve(win, dct)
return dct
end

function imshow(frame::Gtk.GtkFrame, canvas::GtkReactive.Canvas,
Expand Down Expand Up @@ -251,8 +254,11 @@ function imshow(img,

roidict = imshow(guidict["frame"], guidict["canvas"], img, zr, sd, anns)

Gtk.showall(guidict["window"])
Dict("gui"=>guidict, "roi"=>roidict)
win = guidict["window"]
Gtk.showall(win)
dct = Dict("gui"=>guidict, "roi"=>roidict)
GtkReactive.gc_preserve(win, dct)
return dct
end

function imshow(frame::Gtk.GtkFrame, canvas::GtkReactive.Canvas,
Expand All @@ -266,6 +272,7 @@ function imshow(frame::Gtk.GtkFrame, canvas::GtkReactive.Canvas,

roidict = imshow(frame, canvas, imgsig, zr, anns)
roidict["slicedata"] = sd
GtkReactive.gc_preserve(frame, roidict)
roidict
end

Expand Down

0 comments on commit fa205f4

Please sign in to comment.