gui.appendComboBoxItems

Bulk append new items to a comboBox.

Prototype

  1. tComboBoxItems = gui.appendComboBoxItems ( hComponent, nCount )

Description

The returned table must be looped through to set item text, data, etc.


Parameters

hComponent - valid GUI component handle
nCount - number 1..n of how many items you want to insert


Return values

tComboBoxItems - table of (yet empty) appended items


Sample

  1. if ( nTotalItemsToInsert > 0 ) then
  2. tComboItems = gui.appendComboBoxItems ( hComboBox, nTotalItemsToInsert )
  3. end
  4.  
  5. if ( tComboItems ) then
  6. for i = 1, nTotalItemsToInsert do
  7. if ( tItems[i] and #tItems[i] == 3 ) then
  8. gui.setComboBoxItemText ( tComboItems[i], tItems[i][1] )
  9. gui.setComboBoxItemUserData ( tComboItems[i], tItems[i][2] )
  10. gui.setComboBoxItemData ( tComboItems[i], gui.kDataRoleUser + 1, tItems[i][3] )
  11. end
  12. end

Available since ShiVa 2.0