Any change in the Groupbox.font, Groupbox.fontstyle and Groupbox.fontsize properties applies to all contained widgets
Groupbox.fontstyle read/write property
Get or set the Groupbox 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("Groupbox.fontstyle sample", 320, 200)
local groupbox = ui.Groupbox(win, "LuaRT", 10, 50, 300, 140)
ui.Button(groupbox, "Child Button"):center()
-- create a combobox
local cb = ui.Combobox(win, { "bold", "italic", "underline", "heavy", "thin" }, 100, 10)
cb.selected = cb.items[5]
-- change groupbox.fontstyle upon selection
function cb:onSelect(item)
groupbox.fontstyle = { [item.text] = true }
end
groupbox.text = groupbox.font
win:show()
-- update the user interface until the user closes the Window
repeat
ui.update()
until not win.visible