gui.setPictureIcon
Assigns an icon to a component.
Prototype
bOk = gui.setPictureIcon ( hComponent, hIcon )
Parameters
hComponent - valid GUI component handle
hIcon - icon handle
Return values
bOk - true on success
Sample
local hComboBox = gui.getComponentFromInstance ( hInstance, "comboBox" ) local hPicture = gui.getComponentFromInstance ( hInstance, "picture" ) if ( hComboBox and hPicture ) then local hIcon = gui.getComboBoxItemData ( gui.getComboBoxSelectedItem ( hComboBox ), gui.kDataRoleUser + 1 ) if ( utils.getVariableType ( hIcon ) == utils.kVariableTypeIcon ) then gui.setPictureIcon ( hPicture, hIcon ) elseif ( utils.getVariableType ( hIcon ) == utils.kVariableTypeFile ) then gui.setPictureFile ( hPicture, hIcon ) elseif ( utils.getVariableType ( hIcon ) == utils.kVariableTypePixmap ) then gui.setPicturePixmap ( hPicture, hIcon ) elseif ( utils.getVariableType ( hIcon ) == utils.kVariableTypeString ) then gui.setPictureIcon ( hPicture, gui.getIcon ( hIcon ) ) end end
Available since ShiVa 2.0