gui.getComboBoxItemUserData

Retrieves data attached to a GUI component.

Prototype

  1. vValue = gui.getComboBoxItemUserData ( hComboBoxItem )

Description

This function pair (set/get) allows you to attach any kind of variable to a GUI component and retrieve it later.


Parameters

hComboBoxItem - combo box item handle


Return values

vValue - string, number, etc. that was attached


Sample

  1. function onPropertyViewControlFileComboBoxChanged ( hView, hComponent )
  2.  
  3. local hInstance = gui.getParentComponent ( hComponent )
  4. local hSelectedItem = gui.getComboBoxSelectedItem ( hComponent )
  5. local hFile = gui.getComboBoxItemUserData ( hSelectedItem )
  6.  
  7. local hReferenceButton = gui.getComponentFromInstance ( hInstance, "anchorButton" )
  8. if ( hReferenceButton ) then
  9. gui.setReferenceButtonFile ( hReferenceButton, hFile )
  10. end
  11.  
  12. emitPropertyViewControlFileComboSignal ( hInstance, "onPropertyViewControlFileComboValueHasChanged ( hView, hComponent, hFile )" )
  13.  
  14. end

Available since ShiVa 2.0