Label.height read/write property
Get or set the height of the Label area. The height starts from 0 (top side of the Label) and increase to the bottom direction.
Example
local ui = require "ui"
-- create a simple Window
local win = ui.Window("Label.height sample", 320, 200)
local label = ui.Label(win, string.rep("\xE2\x86\x93\n", 9), 150, 60)
local inc_btn = ui.Button(win, "Increase Label.height !", 15, 10)
local dec_btn = ui.Button(win, "Decrease Label.height", inc_btn.x+150, inc_btn.y)
label.fontstyle = { bold = true }
function inc_btn:onClick()
local delta
if self == inc_btn then
delta = 10
else
delta = -10
end
label.height = label.height + delta
end
dec_btn.onClick = inc_btn.onClick
-- shows the Window
win:show()
-- update user interface
repeat
ui.update()
until not win.visible