Any change in the Radiobutton.font, Radiobutton.fontstyle and Radiobutton.fontsize properties results in an automatic resizing of the Radiobutton so that the content is displayed correctly
Radiobutton.fontstyle
Get or set the Radiobutton 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
--! luart-extensions
import ui
-- create a simple Window
local win = ui.Window("Radiobutton.fontstyle sample", 320, 200)
local radiobutton = ui.Radiobutton(win, "LuaRT", 100, 90)
-- create a combobox
local cb = ui.Combobox(win, { "bold", "italic", "underline", "heavy", "thin" }, 94, 30)
-- change radiobutton.fontstyle upon selection
function cb:onSelect(item)
radiobutton.fontstyle = { [item.text] = true }
end
radiobutton.font = "Times New Roman"
radiobutton.fontsize = 24
win:show()
-- update the user interface until the user closes the Window
repeat
ui.update()
until not win.visible