Entry:undo() method
Undoes the last edit operation on the Entry.
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:paste() 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, 150)
local button = ui.Button(win, "Undo", entry.x + entry.width + 8, entry.y-4)
function button:onClick()
entry:undo()
end
win:show()
-- update user interface
repeat
ui.update()
-- enabled button only if entry.canundo is true
button.enabled = entry.canundo and true or false
until not win.visible