Window:onDrop(kind, content) event
This event is fired when the user has dropped the mouse over the Window.
Parameters
kind
A string
representing the kind of content dropped on the Window.
content
The content dropped on the Window, the type of which depends on the following table:
kind | content |
---|---|
"text" |
string |
"files" |
table (list of File and Directory) |
"unkown" |
nil |
Return value
The event returns no value.Example
local ui = require "ui"
-- create a window
local win = ui.Window("Window:onDrop() sample", 640, 480)
win:status("Drop it on the Window !")
win.allowdrop = true
-- set a onDrop() event
function win:onDrop(kind, content)
ui.info("kind: "..kind.."\ncontent: "..tostring(content), "Content dropped on Window")
end
ui.run(win):wait()