Chris, Thanks for the fast response. I guess I wasn't clear. I don't have any event or place in the code I could put a "busy := false" statement. The "not busy" state is only indirectly inferred when the "busy" events stop happening for > 1.3 seconds.
That's why I had my NotBusy procedure triggered by the timer. What I'm trying to accomplish is to have a time that counts down 1.3 seconds and then turns off Busy. If any other events occur during the countdown, the timer is reset and starts counting down again. So the Not-busy event occurs when the timer completes its countdown, 1.3 seconds after the last event. After more inspection of the VCL code, I figured out the problem. The timer's SetEnabled and SetInterval methods only call UpdateTimer if the value of Enabled or Interval is being changed. Unfortunately, UpdateTimer is not a published method. Rather than modifying the VCL, I decided to use the Interval to force an update with a statement like: if Timer.Interval = n then Timer.Interval := n+1 else Timer.Interval := n+1; where n is my desired timout value. This causes a reset of the timer on new events, and keeps the timer running until the end. Thanks, Tim. --- In [email protected], "Chris @ IT" <[EMAIL PROTECTED]> wrote: > > Have a private variable busy > > Public > Busy : Boolean; > End. > > Then on the oncreate have > > Procedure OnCreate(Sender : TObject); > Begin > Busy :=False; > End; > > Then on the timer > > Procedure Tick(Sender : TObject); > Begin > If Busy then > BusyPanel.color := clRed > Else > BusyPanel.color := clGreen; > End; > > Then on your busy code > > Begin > > .. > .. > Busy:=True; > > > //Do your thing here > .. > .. > Busy:=False; > > End; > > U must make sure tho that your busy code refreshes the screen either thru > application.processmessages or self.update and the timer should tick maybe > ever 500 milliseconds > > A neater and better way would be to thread your busy process then when the > thread is over it sets the status bar back to green - would be more elegant > plus wont "hang" your forms. But then again threading has its own issues > depending on what your busy code is doing... > > > Chris Albert, > Innovative Technologies. > http://www.it.co.ke/beta ------------------------ Yahoo! Groups Sponsor --------------------~--> <font face=arial size=-1><a href="http://us.ard.yahoo.com/SIG=12hcq0pvi/M=362131.6882499.7825260.1510227/D=groups/S=1705115362:TM/Y=YAHOO/EXP=1123776666/A=2889191/R=0/SIG=10r90krvo/*http://www.thebeehive.org ">Get Bzzzy! (real tools to help you find a job) Welcome to the Sweet Life - brought to you by One Economy</a>.</font> --------------------------------------------------------------------~-> ----------------------------------------------------- Home page: http://groups.yahoo.com/group/delphi-en/ To unsubscribe: [EMAIL PROTECTED] Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/delphi-en/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/

