The main delay in addItem is probably the fact that each time you add a new item, Windows has to allocate memory for that item.
Having said that, the delay should be very small.
On a P4 1.7Ghz processor, adding 200 items to a listbox takes only 60ms or 0.06 seconds. Adding 2000 items takes just over half a second.
listbox=createListBox(0,0,640,400,0)
btn=createButton(10,420,75,25,"Add Items",0,0)
do
getEvent
if eventSource()=btn and eventType()=MOUSE_CLICK
t1=timer()
for i=n to (n+200)
addItem listbox,"New Item No# " + str$(i)
next i
n=i
t2=timer()
message "Time To Add 200 Items: " + str$(t2-t1)
endif
loop
If you are adding the items in a REPEAT, WHILE or DO loop, you will need to change compiler settings otherwise DBPro does a whole host of checks on every iteration of the loop. Either replace it with a FOR loop, or go into the Compiler\setup.ini file (The "Compiler" folder is inside the main DBPro install folder) and set "RemoveSafetyCode" to "yes".
Also make sure that there is no other slowdown in the code which adds the items.
If it does turn out to be Blue2's addItem command slowing things down, there are some Windows API calls which you can make which allocate the memory in one large block before adding the new items, which should improve performance, and I'll post some examble DB code for them.
BlueGUI:Windows UI Plugin - All the power of the windows interface in your DBPro games.