Re: [lazarus] Dumb question - updating a progressbar

2006-02-01 Thread A.J. Venter
On Wednesday 01 February 2006 16:40, A.J. Venter wrote:
> Hi all,
> Why is it that I cannot seem to get my progressbar to update ¨live¨
>
> I am trying to show the progress of decompressing files when the user
> selects a multifile book in OpenBook.
>
Don't worry about it, I decided to do the right thing(tm) and I used a thread.

All good now :)

A.J.
-- 
A.J. Venter
Chief Software Architext
OpenLab International
www.getopenlab.com
www.silentcoder.co.za
+27 82 726 5103

_
 To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] Dumb question - updating a progressbar

2006-02-01 Thread Michael Van Canneyt



On Wed, 1 Feb 2006, A.J. Venter wrote:


Hi all,
Why is it that I cannot seem to get my progressbar to update ¨live¨

I am trying to show the progress of decompressing files when the user selects
a multifile book in OpenBook.


The code is like this (hugely snipped)

extractpb.position := 0;

For I := 1 to FileLIst.Count -1 do
Begin
extractpb.Position := percentage(I + 1,FileList.Count

end;

This all gets called from a procedure OUTSIDE the form class simply called
decompress.

What happens however is that when I trigger the process, the read book button
stays depressed, and the progressbar neatly on 0 until the book is actually
OPEN, only then does the form update.

I tried to put an invalidate call after setting position - no luck.

Surely I don`t need a thread just to do a progressbar ? After all, I am not
updating it on the progress PER FILE but in between on the progress of how
many files are done, shouldn`t that be a fairly simple process ?

Any help as always, greatly appreciated.


After
 extractpb.Position := percentage(I + 1,FileList.Count
add
  Application.ProcessMessages;

Michael.