gui.appendListItem

Adds a new empty item to a list.

Prototype

  1. hListItem = gui.appendListItem ( hComponent )

Parameters

hComponent - valid GUI component handle


Return values

hListItem - list item handle


Sample

  1. function onMainViewRefreshAdditionalFilesList ( hList, sAdditionalFiles )
  2.  
  3. if ( hList ) then
  4. local tFiles = string.explode ( sAdditionalFiles, ";" )
  5.  
  6. if ( tFiles ) then
  7. gui.removeAllListItems ( hList )
  8.  
  9. for i = 1, #tFiles do
  10. local sFile = tFiles[i] -- TODO: trim spaces
  11.  
  12. if ( sFile ~= "" ) then
  13. local hItem = gui.appendListItem ( hList )
  14.  
  15. if ( hItem ) then
  16. gui.setListItemText ( hItem, sFile )
  17. end
  18.  
  19. end
  20.  
  21. end
  22. end
  23. end
  24. end

Available since ShiVa 2.0