how to use PtGenListAddItems

Hi,
I didn’t find how to use PtGenListAddItems.
I try to do:

typedef struct line_item_s {
PtGenListItem_t gen_list_item;
char line[1024];
}line_item_t;

line_item_t *list_items = NULL;

line_item_t essai[5] = {{{0},{“00\t00\t00\t00\t00\t00\t00\t00\t–/–/–
–:–:–\t–/–/-- --:–:–\tEssai 1”}},

{{0},{“00\t00\t00\t00\t00\t00\t00\t00\t–/–/-- --:–:–\t–/–/–
–:–:–\tEssai 2”}},

{{0},{“00\t00\t00\t00\t00\t00\t00\t00\t–/–/-- --:–:–\t–/–/–
–:–:–\tEssai 3”}},

{{0},{“00\t00\t00\t00\t00\t00\t00\t00\t–/–/-- --:–:–\t–/–/–
–:–:–\tEssai 4”}},

{{0},{“00\t00\t00\t00\t00\t00\t00\t00\t–/–/-- --:–:–\t–/–/–
–:–:–\tEssai 5”}}};


int
GetListe( PtWidget_t *widget, ApInfo_t *apinfo, PtCallbackInfo_t *cbinfo )

{


essai[0].gen_list_item.next = &essai[1].gen_list_item;
essai[0].gen_list_item.size.h = 20;
essai[1].gen_list_item.next = &essai[2].gen_list_item;
essai[1].gen_list_item.size.h = 20;
essai[2].gen_list_item.next = &essai[3].gen_list_item;
essai[2].gen_list_item.size.h = 20;
essai[3].gen_list_item.next = &essai[4].gen_list_item;
essai[3].gen_list_item.size.h = 20;

PtGenListAddItems(ABW_PtList_msgListe, &essai[0].gen_list_item, NULL);

/* eliminate ‘unreferenced’ warnings */
widget = widget, apinfo = apinfo, cbinfo = cbinfo;

return( Pt_CONTINUE );



}

The list is created, I can select items by mouse but when I press any key
within the list, I get a SIGSEGV.

What’s wrong?

Thanks,
Alain.

Alain Bonnefoy wrote:

I didn’t find how to use PtGenListAddItems.
I try to do:

 ...

[quote]The list is created, I can select items by mouse but when I press any key
within the list, I get a SIGSEGV.
[/quote]
That's exactly how PtGenList expects PtGenListAddItems() to be used; but 
most subclasses of PtGenList provide their own ways of creating and 
adding items and don't want you to use PtGenListAddItems() directly. 
What kind of a widget are you trying this with?