Skip to content

Return of Reckoning

Wiki

RoR Wiki

API:ButtonSetCheckButtonFlag

From RoR Wiki
Revision as of 19:40, 16 October 2026 by Maintenance script (talk | contribs) (UI Lua API import (WAR 1.4.8))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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 – true to make the button a check button, false for 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 ButtonSetStayDownFlag instead of ButtonSetCheckButtonFlag.
  • isCheckButton must be a real boolean. Passing nil or 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 exist
  • Error 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);

See also