Entry:autosize() method


Resize the Entry automatically to accommodate its content.

Return value

This function returns no value.

Example

local ui = require "ui" -- create a simple Window local win = ui.Window("Entry:autosize() sample", 320, 200) -- add a tiny Entry... local entry = ui.Entry(win, "LuaRT", 113, 80) -- ...with a big font entry.font = "Impact" entry.fontsize = 18 -- resize to a small entry entry.width = 20 entry.height = 16 -- ...and a Button ui.Button(win, "Show Entry.text", 100, 10).onClick = function (self) entry:autosize() self.enabled = false end win:show() -- update the user interface until the user closes the Window repeat ui.update() until not win.visible