API:ButtonSetPressedFlag
From RoR Wiki
UI Lua API · Button functions
Version: WAR 1.4.8
Sets or clears the pressed state of a Button.
ButtonSetPressedFlag(buttonName, pressed)
Arguments
- buttonName
string– Name of a Button window.- pressed
boolean–trueto show the button pressed,falseto release it.
Returns
Nothing.
Details
- This is how the stock UI checks and unchecks check boxes and shows toggle buttons as active.
- The button's text colour changes to the colour set for its new state (see ButtonSetTextColor).
- The client also changes the flag when the button is clicked (see ButtonGetPressedFlag).
pressedmust 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 'ButtonSetPressedFlag': Window %s does not existError in function call 'ButtonSetPressedFlag': Window %s is not a Button
Example
Showing a window's toolbar button as pressed while the window is open, from easystem_windowutils/source/windowutils.lua:
for index, buttonName in ipairs( WindowUtils.stateButtons[ windowName ] ) do
ButtonSetPressedFlag( buttonName, true )
end
