Edit.constructor(parent, text, [ x ], [ y ], [ width ], [ height ]) constructor


The Edit constructor returns an Edit value representing a Windows RichEdit control on the parent object.

Parameters

parent

An object that will own the Edit. Parent objects can be any of Window, Groupbox, TabItem and Panel

text

A string representing the Edit's text content.

x

An optional number that indicates the Edit horizontal position, in pixels. Zero means the left border of the parent.

y

An optional number that indicates the Edit vertical position, in pixels. Zero means the top border of the parent.

width

An optional number that indicates the Edit width in pixels.

height

An optional number that indicates the Edit height in pixels.

Example

local ui = require "ui" -- create a simple Window local win = ui.Window("Edit.constructor() sample", 270, 220) local lorem = [[Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.]] -- create an Edit on this window, with lorem as text, at the x position 10, and y position 10 local edit = ui.Edit(win, lorem, 10, 10) edit.wordwrap = true win:show() -- update the user interface until the user closes the Window repeat ui.update() until not win.visible