Skip to content

Instantly share code, notes, and snippets.

@SimonDanisch
Created October 22, 2015 00:22
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 SimonDanisch/e0a8a2cbc3106ce6c123 to your computer and use it in GitHub Desktop.
Save SimonDanisch/e0a8a2cbc3106ce6c123 to your computer and use it in GitHub Desktop.
drag and drop with glvisualize and fileio
function handle_drop(w, files)
if !isempty(files)
qfiles = map(FileIO.query, files)
readable_files = filter(x-> !FileIO.unknown(x), qfiles)
visualized_files = map(visualize, map(FileIO.load, readable_files))
files_square = reshape(visualized_files, close_to_square(length(visualized_files))) # turn it into a matrix -> grid
view(visualize(files_square), w, method=:perspective)
end
nothing
end
const_lift(handle_drop, window, window.inputs[:droppedfiles])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment