Tab.fontstyle read/write property
Get or set the Tab 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("Tab.fontstyle sample", 320, 260)
ui.Label(win, "font size :", 100, 10)
local tab = ui.Tab(win, {"Item 1", "Item 2", "Item 3"}, 10, 30)
tab.selected = tab.items[1]
-- create a font style tab
local cb = ui.Combobox(win, { "thin", "italic", "underline", "strike", "bold", "heavy" }, 150, 6, 80)
cb.selected = cb.items[1]
-- change tab.fontstyle upon selection
function cb:onSelect(item)
tab.fontstyle = { [item.text] = true }
win:status("Tab fontstyle : "..item.text)
end
win:show()
-- update the user interface until the user closes the Window
repeat
ui.update()
until not win.visible