PtList -> PtListAddItems()

Hello all,
We are building an applications that will the display data receive from the serial port. We would like to use the PtList widget to dispay the data. The last item received get add to the bottom of the list and the top line get deleted which scroll all the items. Work pretty good with constant but can’t make it work with reel data. So hoppefully someone will be able to help me.

int PtListAddItem ( PtWidget_t * widget, const char **items, int item_count, unsigned int position);

Ok this is what we have done so far and work great

const char * const MyData[] ={ “Hello World”};
const unsigned short MyListPos = 1;

#define MAX_LINE 10

if (i >MAX_LINE)
PtListRemovePositions (ABW_MyList, &MyListPos, MAX_LINE);

PtListAddItems (ABW_MyList , MyData , 1 , 0);

if we try to replace the const by some data then it won’t work. I’m still very confuse about the const char** versus char **.

I was hoping to define an array such as

char Mydata[1][100]

and pass it to the function but got error

This screen will display data in reel time and i would hate to use malloc & free everytime we update the list. So if anyone have any input that would be great.


I think i got it

char *Line[1];
char MyData[100];

sprintf(MyData, “%s”, “Hello World”);
Line[0] = MyData;
PtListAddItems(widget, (const char**)Line, 1,0);


char MyLine[1][100];

sprintf(MyLine[0], “%s”, “Hello World”);
PtListAddItems(widget, (const char**)MyLine, 1,0);

Doesn’t work