API:ButtonSetCheckButtonFlag
From RoR Wiki
UI Lua API · Button functions
Version: WAR 1.4.8
Makes a Button behave as a check button that toggles on each click.
ButtonSetCheckButtonFlag(buttonName, isCheckButton)
Arguments
- buttonName
string– Name of a Button window.- isCheckButton
boolean–trueto make the button a check button,falsefor normal behaviour.
Returns
Nothing.
Details
- On a check button, each left-button press toggles the pressed flag, and releasing the mouse button does not clear it. Read the checked state with ButtonGetPressedFlag and set it with ButtonSetPressedFlag.
- Changing the flag does not change the button's current pressed state or appearance.
- The error messages name
ButtonSetStayDownFlaginstead ofButtonSetCheckButtonFlag. isCheckButtonmust be a real boolean. Passingnilor a number raises an Invalid Parameters error.- The function needs at least two arguments and only reads the last two.
Errors
Error in function call 'ButtonSetStayDownFlag': Window %s does not existError in function call 'ButtonSetStayDownFlag': Window %s is not a Button
Example
Setting up a "never warn again" check box, from easystem_dialogmanager/source/dialogmanager.lua:
local warningButton = "TwoButtonDlg"..dlg.."BoxNeverWarnButton"; ButtonSetCheckButtonFlag (warningButton, true); ButtonSetPressedFlag (warningButton, false);
