Skip to content

Instantly share code, notes, and snippets.

@tknopp
Last active August 29, 2015 14:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tknopp/ae56b0509a0a4b80cfe1 to your computer and use it in GitHub Desktop.
Save tknopp/ae56b0509a0a4b80cfe1 to your computer and use it in GitHub Desktop.
Gtk/Winston Performance
using Gtk.ShortNames, Gtk.GConstants
using Winston
function PerformanceTestApp()
I = zeros(1024,1024)
vbox = @Box(:v)
slSlicePos = @Scale(false, 1:1024)
adjSlicePos = @Adjustment(slSlicePos)
push!(vbox,slSlicePos)
G_.value(slSlicePos, 1)
c = @Canvas()
push!(vbox, c)
setproperty!(vbox, :expand, c, true)
inUpdateImage = false
function updateImage( widget=nothing )
if !inUpdateImage
inUpdateImage = true
I[:] = 0.0
I[:, int( G_.value(adjSlicePos) ) ] = 1.0
p = imagesc( I )
display(c,p)
inUpdateImage = false
end
end
signal_connect(updateImage, adjSlicePos, "value_changed")
win = @Window(vbox, "Canvas")
showall(win)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment