Edit:paste() method
Paste the Windows clipboard content to the Edit object.
Return value
This function returns no value.Example
local ui = require "ui"
-- create a fixed Window to hold the buttons
local win = ui.Window("Edit:paste() sample", "fixed", 320, 200)
local label = ui.Label(win, "Enter text : ", 25, 80)
local edit = ui.Edit(win, "", label.x + label.width + 8, label.y-4, 150)
local button = ui.Button(win, "Paste", edit.x + edit.width + 8, edit.y-4)
function button:onClick()
edit:paste()
end
win:show()
-- update user interface
repeat
ui.update()
-- enabled button only if clipboard is not empty
button.enabled = sys.clipboard and true or false
until not win.visible