Combobox.fontstyle read/write property
Get or set the Combobox 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("Combobox.fontstyle sample", 320, 200)
local combobox = ui.Combobox(win, {"Item 1", "Item 2", "Item 3"}, 96, 100)
combobox.selected = combobox.items[1]
-- create a font style combobox
local cb = ui.Combobox(win, { "bold", "italic", "underline", "heavy", "thin" }, 104, 30)
cb.selected = cb.items[5]
-- change combobox.fontstyle upon selection
function cb:onSelect(item)
combobox.fontstyle = { [item.text] = true }
end
combobox.font = "Times New Roman"
combobox.fontsize = 24
win:show()
-- update the user interface until the user closes the Window
repeat
ui.update()
until not win.visible