best way of updating a progbar

BlitzMax Forums/BlitzMax GUI Programming/best way of updating a progbar

I've got an intesnse process loop and would like to cerate a progress bar.
I have created progress bar but it doesn't update (the whole window is disabled). I belive this is due to the processing in the background.

How can i force an update or slow my loop down so windows can update the app window?

you could pop a delay 1 or flip and cls. Don't forget that without cls or flip your screen will appear static. This comes at a price though, because loading takes longer if you show it with a flip and delay.

Oh, and if you're going to do a progress bar then please, when it reaches 100%, it's done. Not still loading. i really hate that in games. You sit there waiting for it and when it gets to 100% (theoretically done), it still continues to load!

function loadgame()

showProgressBar(50,"loading people")
loadPeople()

showProgressBar(99,"Loading tanks")
loadTanks()

end function

function showProgressBar(perc,st$)
cls

drawrect 10,10,perc,10
drawtext st,10,22

flip
delay 1
end function


for the ProgressBar gadget, put a PollSystem() inside the loop. that should take care of it =)

cheers grable, i will try the pollsystem() command.
rimmsy.. that code would work for max2d, but I was after something for the GUI module.

that worked, cheers

Doh!