Hi, im trying to make a list, i create the dialog, and its all okey, but when i try to select anything from the list, i make a hint reporting the index and the text, and the index in all the cases is -1, is like when i select an menu option, and it doesent select, any idea, for why it happends. Here is the code:
createDialog "cuerposDiag";
_display = findDisplay 7726;
_lista = _display displayCtrl 5245;
_boton = _display displayCtrl 1600;
_arrayCuerpos = [
"Cuerpo1",
"Cuerpo2",
"Cuerpo3",
"Cuerpo4",
"Cuerpo5"
];
lbClear _lista; //Limpio la lista.
_indexArray = 0;
while {_indexArray < (count _arrayCuerpos)} do {
_lista lbAdd (_arrayCuerpos select _indexArray);
_lista lbSetData [_indexArray, (_arrayCuerpos select _indexArray)];
_indexArray = _indexArray + 1;
};
index = lbCurSel _lista;
getLbText = _lista lbText index;
life_fnc_boton = {
if (index == -1) exitWith {
hint "No has seleccionado ninguna opción";
};
hint format ["%1 | %2", getLbText, index];
};
_boton buttonSetAction '[] call life_fnc_boton;';