List.fontstyle read/write property
Get or set the List font style, a table value that contains the following keys/values :
- "italic" : set to true if the font is in italic.
- "underline" : set to true if the font is underlined.
- "strike" : set to true if the font is
striked. - "thin" : set to true if the font is thin.
- "bold" : set to true if the font is bold.
- "heavy" : set to true if the font is heavy.
Example
local ui = require "ui"
-- create a simple Window
local win = ui.Window("List.fontstyle sample", 320, 200)
ui.Label(win, "font size :", 100, 20)
local list = ui.List(win, {"Item 1", "Item 2", "Item 3"}, 130, 50)
list.selected = list.items[1]
-- create a font style list
local cb = ui.Combobox(win, { "thin", "italic", "underline", "strike", "bold", "heavy" }, 150, 16, 80)
cb.selected = cb.items[1]
-- change list.fontstyle upon selection
function cb:onSelect(item)
list.fontstyle = { [item.text] = true }
win:status("List fontstyle : "..item.text)
end
win:show()
-- update the user interface until the user closes the Window
repeat
ui.update()
until not win.visible