Fast gadget redraw, how?
Posted: Mon Feb 04, 2013 1:05 pm
Hi, i have on big list that is loading about 30 sec minimum. In that loading time i have to show in stringgadget, how much lines are loaded. Problem is, that if i redraw whole window after every loaded lines, the loading process is 10 times slower. How i can redraw only one gadget?
Code: Select all
If OpenWindow(0, 100, 100, 300, 430, "ListIcon Example", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
ListIconGadget(0, 5, 5, 290, 390, "Name", 100, #PB_ListIcon_GridLines | #PB_ListIcon_FullRowSelect | #PB_ListIcon_AlwaysShowSelection)
StringGadget(1, 5, 405, 85, 20, "")
AddGadgetColumn(0, 1, "Address", 250)
For i = 1 To 35000
AddGadgetItem(0, -1, Str(i)+Chr(10)+"PureBasic Road, BigTown, CodeCity")
SetGadgetText(1,Str(i))
While WindowEvent() : Wend ; this is to slow
Next
Repeat
Event = WaitWindowEvent()
Until Event = #PB_Event_CloseWindow
EndIf