Skip navigation.
Home
The QNX Community Portal

View topic - How to show just last 11 elements at a list?

How to show just last 11 elements at a list?

Isn't the name clear?

How to show just last 11 elements at a list?

Postby robert » Fri Jun 01, 2007 3:04 pm

Hello,

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
Code: Select all
PtListAddItems(ABW_PtList_Output, (const char**)&pstr, 1, 1);

If i got more than 11 elements at list i delete one
Code: Select all
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?

Thanks,
Robert
Code: Select all
robert
Active Member
 
Posts: 15
Joined: Thu Aug 01, 2002 1:42 pm
Location: Germany

RE: How to show just last 11 elements at a list?

Postby micro » Sun Jun 03, 2007 11:38 am

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.
micro
Senior Member
 
Posts: 458
Joined: Thu Jul 22, 2004 8:41 pm

RE: How to show just last 11 elements at a list?

Postby robert » Mon Jun 04, 2007 7:27 am

i want to display last incomming nmea sequences (http://en.wikipedia.org/wiki/NMEA).

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.
robert
Active Member
 
Posts: 15
Joined: Thu Aug 01, 2002 1:42 pm
Location: Germany


Return to GUI Programming

Who is online

Users browsing this forum: No registered users and 3 guests