Skip to content

Return of Reckoning

Wiki

RoR Wiki

API:ComboBoxClearMenuItems

From RoR Wiki

UI Lua API · ComboBox functions
Version: WAR 1.4.8

Removes all items from a ComboBox's menu.

ComboBoxClearMenuItems(comboBoxName)

Arguments

comboBoxName
string – Name of the ComboBox.

Returns

Nothing.

Details

  • The menu's item buttons are destroyed and the selection is cleared: the selected-item text becomes empty and ComboBoxGetSelectedMenuItem returns 0.
  • If an item was selected before the call, the ComboBox's OnSelChanged handler runs with 0. Unlike ComboBoxSetSelectedMenuItem, this does trigger the handler, so guard your handler if it should ignore the reset.

Errors

The type error says ComboBoxCast:

  • Error in function call 'ComboBoxClearMenuItems': Window %s does not exist
  • Error in function call 'ComboBoxClearMenuItems': Window %s is not a ComboBoxCast

Example

From default/ea_settingswindow/source/settingswindowtabinterface.lua:

ComboBoxClearMenuItems( settingsBarName.."Rows" )
...
ComboBoxAddMenuItem(  settingsBarName.."Rows", towstring( j ) )

See also