Adding items in a list box from code

In Photon, I hv a problem writing list of items at different positions in a list box using code. I’m using QNX Momentics 6.2.1 with Photon.
My Requirement is that I 've created a List Box using Photon Application Builder. From my timer callback code, I want to write the items in the list box. I tried using PtListAddItems but was not successful.Can anyone send a code snippet for this problem.


PtListAddItems() has always worked well for me, but you need to remember to state how long the array is, and the position to place them in the listbox, I always forget the latter. If that does not work, post your code and we can take a look.

Hi !,
I’m enclosing the the code snippet to address different pos in the list box kept as a child into the scroll container.

In timer callback , the foll code is called

int MaxCount = 20;
int First = 1;
int pos = 1;

line[0] = my_line;
PtListAddItems(ABW_List1,(const char**)line,1 pos);
pos += 5;

I expected the code to print at different locations based on pos value, but didn’t

Can anyone help me in this reg.