The Edit widget will scroll down automatically to show the just appended text.
Edit:append(text) method
Append text to Edit content, just after the last character position.
Parameters
text
A string, representing the text to append to the Edit content.
Return value
This function returns no value.Example
local ui = require "ui"
-- create a simple window
local win = ui.Window("Edit.load sample", "fixed", 520, 460)
local button = ui.Button(win, "Append text",200, 10)
local edit = ui.Edit(win, "", 10, 44, 500, 410)
-- set edit.properties
edit.font = "Courier New"
edit.fontsize = 8
edit.wordwrap = true
function button:onClick()
edit:append("Hello LuaRT ! ")
end
win:show()
-- update user interface
repeat
ui.update()
until not win.visible