Entry:copy() method


Copies the current Entry text to the clipboard.

Return value

This function returns no value.

Example

local ui = require "ui" -- create a fixed Window to hold the buttons local win = ui.Window("Entry:copy() sample", "fixed", 320, 200) local label = ui.Label(win, "Enter text : ", 25, 80) local entry = ui.Entry(win, "", label.x + label.width + 8, label.y-4) local button = ui.Button(win, "Copy text", entry.x + entry.width + 8, entry.y-4) function button:onClick() ui.info("You have copied '"..entry.text.."' to the clipboard") entry:copy() end win:show() -- update user interface repeat ui.update() until not win.visible