How to show just last 11 elements at a list?


i want to get a list widget with 11 entries.
If i got 11 elements at list and put a new one into it i want delete the oldest element at list.

How could i realize that?

Actual i got a PtList and put all elements on top of list PtListAddItems(ABW_PtList_Output, (const char**)&pstr, 1, 1);
If i got more than 11 elements at list i delete one

PtListDeleteItemPos(ABW_PtList_Output, 1, item_num);

But the Problem is that the window and cursor is jittering all the time.

What could is do, any hints?



Try deleting (if the next item would be 12) then inserting, then setting focus to the right item. And as the last spot, refresh the List.
It will jitter also if you refesh ever half second.
Depending on the speed new items should pop up, try another widget or build one yourself.
For example use single Labels, they should not jitter that much, but you have to set the LabelText on all 11 then.

A good start would be to provide some more information about what you intend to do.

i want to display last incomming nmea sequences (

May i refresh the list more than 5 times per second.
Because of this i am looking how to avoid a automaticaly refresh of widgets and how to refresh the PtList manualy.