Last active
August 29, 2015 14:03
-
-
Save tknopp/ae56b0509a0a4b80cfe1 to your computer and use it in GitHub Desktop.
Gtk/Winston Performance
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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