API:ButtonSetStayDownFlag
From RoR Wiki
UI Lua API · Button functions
Version: WAR 1.4.8
Makes a Button stay pressed after it is clicked.
ButtonSetStayDownFlag(buttonName, stayDown)
Arguments
- buttonName
string– Name of a Button window.- stayDown
boolean–trueto make the button stay pressed,falsefor normal behaviour.
Returns
Nothing.
Details
- When a stay-down button is released:
- over the button, it stays pressed;
- away from the button, it stays pressed only if it was already pressed before the click.
- A normal button is released (its pressed flag cleared) when the mouse button goes up.
- Use ButtonSetPressedFlag to release a stay-down button from Lua.
- Changing the flag does not change the button's current pressed state or appearance.
stayDownmust 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
From eatemplate_defaultwindowskin/source/defaultbutton.lua:
function EA_Window_DefaultLabelToggleCircle.Initialize() local buttonName = SystemData.ActiveWindow.name.."Button" ButtonSetStayDownFlag( buttonName, true ) end
