Checkbox:autosize() method


Resize the Checkbox 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("Checkbox:autosize() sample", 320, 200) -- add a tiny Checkbox... local checkbox = ui.Checkbox(win, "LuaRT", 120, 70) -- ...with a big font checkbox.font = "Impact" checkbox.fontsize = 18 -- resize to a small checkbox checkbox.width = 30 checkbox.height = 16 -- ...and a Checkbox ui.Button(win, "Autosize Checkbox", 112, 10).onClick = function (self) checkbox:autosize() self.enabled = false end win:show() -- update the user interface until the user closes the Window repeat ui.update() until not win.visible