Skip to content

Return of Reckoning

Wiki

RoR Wiki

API:ButtonGetText

From RoR Wiki

UI Lua API · Button functions
Version: WAR 1.4.8

Returns the text shown on a Button.

text = ButtonGetText(buttonName)

Arguments

buttonName
string – Name of a Button window.

Returns

text
wstring – The button's text, or L"" if the button has no text label.

Details

  • The text is copied into a buffer of 256 wide characters before it is returned, so at most the first 255 characters come back.
  • Like LabelGetText, it returns the text as displayed, which may differ from the string passed to ButtonSetText.

Errors

  • Error in function call 'ButtonGetText': Window %s does not exist
  • Error in function call 'ButtonGetText': Window %s is not a Button

Example

Copying a chat tab's name into the rename box, from ea_chatwindow/source/chatwindow.lua:

TextEditBoxSetText( "ChatWindowRenameWindowText", ButtonGetText( tabButtonName ) )

Comparing a button's caption, from ea_guildwindow/source/guildwindowtabadmin.lua:

if ButtonGetText("GWAdminCommandAddRemoveTitleButton") == GetGuildString(StringTables.Guild.BUTTON_GUILD_ADMIN_COMMAND_ADD_TITLE) then

See also