Groupbox.font read/write property


Get the Groupbox font, a string value that represent the font name.

To set the Groupbox.font property, you can assign a string that represent either a font name of an installed system font, or a font file (*.ttf, *.fon...).
A File can also be provided, representing a font file.

Note that only the font family is changed. The font style and font size are not affected (see the Groupbox.fontstyle and the Groupbox.fontsize properties).

Example

local ui = require "ui" -- create a simple window local win = ui.Window("Groupbox.font sample", 320, 300) local button = ui.Button(win, "Change Groupbox.font", 90, 10) local groupbox = ui.Groupbox(win, "", 70, 60) groupbox.label = ui.Label(groupbox, "Label", 10, 50) groupbox.button = ui.Button(groupbox, "Button", 10, groupbox.label.y + 30) groupbox.text = groupbox.font.." "..groupbox.fontsize.."px" -- Button:onClick() event to change Groupbox.font function button:onClick() groupbox.font = "Courier New" groupbox.fontsize = 8 groupbox.text = groupbox.font.." "..groupbox.fontsize.."px" end win:show() -- update the user interface until the user closes the Window repeat ui.update() until not win.visible