Hi, I want to know how to use the resources Pt_ARG_LIST_ITEMS and Pt_ARG_SELECTED_INDEXES to know wich element is selected in a PtList, and how to get the text of that items.
thanks.
Hi, I want to know how to use the resources Pt_ARG_LIST_ITEMS and Pt_ARG_SELECTED_INDEXES to know wich element is selected in a PtList, and how to get the text of that items.
thanks.
the resources is Pt_ARG_LIST
the resources Pt_ARG_LIST_ITEMS no exist
//To Load a PtList Widget:
void LoadPlist (void)
{
char buf[200];
char *punt;
punt = buf;
//Pasa a buf los datos a mostrar
sprintf (buf, "MI MAMA ME MIMA");
//Carga en la lista lo que esta en buf (punt apunta a buf)
PtListAddItems (ABW_Lista, (const char **)&punt, 1, 0);
}
//To Delete ALL ITEMS in PtList
PtListDeleteAllItems (ABW_Lista);
Gracias, me sirve, pero lo que me interesa saber es, una vez que ya tengo cargado el PtList, cómo hago para saber que elemento esta seleccionado y cómo obtengo el texto del elemento seleccionado.
gracias.
i just want to know wich item is selected in a PtList widget, and how to get the text of that item. please.
I have the same question.thanks for reply.
Somting like this
In PtLIst widget add callback type Pt_CB_SELECTION on function fun(…)
fun(…)
{
unsigned short index;
char *item_text, **item_mas;
PtGetResource(list_wgt, Pt_ARG_SELECTION_INDEXES, index, 1)
PtSetArg(&arg, Pt_ARG_ITEMS, item_mas, 0);
PtGetResources(list_wgt, 1, &arg)
item_text = item_mas[index-1]; — frst item have number 1
}
thanks for qnxloader.