Re: [Lazarus] Lazarus and Application.ProcessMessages

2014-12-08 Thread Michael Schnell
On 12/07/2014 10:05 PM, Mattias Gaertner wrote: HandleMessage waits until a message is in the queue, calls ProcessMessages and returns. Does it wait up as well when some Event is pushed upon the GUI queue (in Windows a Windows message occurs, in Linux a Lazarus Event), as when an Event

Re: [Lazarus] Lazarus and Application.ProcessMessages

2014-12-08 Thread Michael Schnell
On 12/08/2014 10:03 AM, Michael Schnell wrote: Does it wait up Sorry Typo: wake up -Michael -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Re: [Lazarus] Lazarus and Application.ProcessMessages

2014-12-08 Thread Mattias Gaertner
On Mon, 08 Dec 2014 10:03:15 +0100 Michael Schnell mschn...@lumino.de wrote: On 12/07/2014 10:05 PM, Mattias Gaertner wrote: HandleMessage waits until a message is in the queue, calls ProcessMessages and returns. Does it wait up as well when some Event is pushed upon the GUI queue (in

Re: [Lazarus] Lazarus and Application.ProcessMessages

2014-12-08 Thread Michael Schnell
On 12/08/2014 10:20 AM, Mattias Gaertner wrote: BTW, TThread.Synchronize is hardly a queue. Yes there is a Queue (internally in the RTL it's called *ThreadQueue* ) This is the source code in the RTL: class procedure TThread.Synchronize(AThread: TThread; AMethod: TThreadMethod); begin

Re: [Lazarus] Lazarus and Application.ProcessMessages

2014-12-08 Thread Lukasz Sokol
On 05/12/14 13:53, Michael Schnell wrote: On 12/04/2014 04:24 PM, Lukasz Sokol wrote: Or e.g. I run FindFirst/FindNext loop over a large number of files, or even if I delegate reading of a file to another procedure, still takes time while nothing else can happen... (although /that/ actually I

Re: [Lazarus] Lazarus and Application.ProcessMessages

2014-12-07 Thread Flávio Etrusco
On Sat, Dec 6, 2014 at 1:15 PM, Mattias Gaertner nc-gaert...@netcologne.de wrote: On Sat, 06 Dec 2014 16:02:40 +0100 JuuS j...@mykolab.ch wrote: Hi all, A bit late with this and haven't read everything through and through but... I worked with Delphi for some time and, yes,

Re: [Lazarus] Lazarus and Application.ProcessMessages

2014-12-07 Thread Mattias Gaertner
On Sun, 7 Dec 2014 22:05:29 +0100 Mattias Gaertner nc-gaert...@netcologne.de wrote: On Sun, 7 Dec 2014 16:50:10 -0300 Flávio Etrusco flavio.etru...@gmail.com wrote: [...] Also implemented in Lazarus. HandleMessage waits till the next message. Unfortunately in Lazarus it doesn't

Re: [Lazarus] Lazarus and Application.ProcessMessages

2014-12-06 Thread JuuS
Hi all, A bit late with this and haven't read everything through and through but... I worked with Delphi for some time and, yes, Application.Processmessages brings system to knees and processor to 100%. But in Delphi there was also an Application.Handlemessage...used like this: repeat

Re: [Lazarus] Lazarus and Application.ProcessMessages

2014-12-06 Thread Mattias Gaertner
On Sat, 06 Dec 2014 16:02:40 +0100 JuuS j...@mykolab.ch wrote: Hi all, A bit late with this and haven't read everything through and through but... I worked with Delphi for some time and, yes, Application.Processmessages brings system to knees and processor to 100%. But in Delphi there

Re: [Lazarus] Lazarus and Application.ProcessMessages

2014-12-05 Thread Michael Schnell
On 12/04/2014 04:24 PM, Lukasz Sokol wrote: Executing a thread, which would TOO contain Sleep() in its Execute, and then calling into next part of the startup procedure ? When doing threads a completely different paradigm needs to be applied. - TTimer can't be used in a thread - sleep often

Re: [Lazarus] Lazarus and Application.ProcessMessages

2014-12-05 Thread Michael Schnell
On 12/04/2014 04:24 PM, Lukasz Sokol wrote: Or e.g. I run FindFirst/FindNext loop over a large number of files, or even if I delegate reading of a file to another procedure, still takes time while nothing else can happen... (although /that/ actually I can imagine doing in a thread). Then such

Re: [Lazarus] Lazarus and Application.ProcessMessages

2014-12-05 Thread Lukasz Sokol
On 04/12/14 20:34, waldo kitty wrote: On 12/4/2014 10:24 AM, Lukasz Sokol wrote: (OnTimer execution has the same problem : inevitably splits the procedure into more procedures, that can no longer use same local variables and stuff) you can't make them subroutines of the subroutine?

Re: [Lazarus] Lazarus and Application.ProcessMessages

2014-12-04 Thread Michael Schnell
On 12/03/2014 11:37 PM, Terry A. Haimann wrote: I have a program that starts some background processes and then needs to go to sleep for 15 seconds or so and then come back and check on their statuses. A more decent way is to leave the current event and use a TTimer (e.g. with en event

Re: [Lazarus] Lazarus and Application.ProcessMessages

2014-12-04 Thread Lukasz Sokol
Hi, (for md as well as Michael) On 04/12/14 08:35, Michael Schnell wrote: On 12/03/2014 11:37 PM, Terry A. Haimann wrote: I have a program that starts some background processes and then needs to go to sleep for 15 seconds or so and then come back and check on their statuses. A more decent

Re: [Lazarus] Lazarus and Application.ProcessMessages

2014-12-04 Thread Paul Breneman
On 12/03/2014 04:51 PM, Paul Breneman wrote: On 12/03/2014 04:37 PM, Terry A. Haimann wrote: I have a program that starts some background processes and then needs to go to sleep for 15 seconds or so and then come back and check on their statuses. So I used a loop like the following: EndTime

Re: [Lazarus] Lazarus and Application.ProcessMessages

2014-12-04 Thread Frederic Da Vitoria
2014-12-04 18:20 GMT+01:00 Paul Breneman list2...@brenemanlabs.com: On 12/03/2014 04:51 PM, Paul Breneman wrote: On 12/03/2014 04:37 PM, Terry A. Haimann wrote: I have a program that starts some background processes and then needs to go to sleep for 15 seconds or so and then come back and

Re: [Lazarus] Lazarus and Application.ProcessMessages

2014-12-04 Thread waldo kitty
On 12/4/2014 10:24 AM, Lukasz Sokol wrote: (OnTimer execution has the same problem : inevitably splits the procedure into more procedures, that can no longer use same local variables and stuff) you can't make them subroutines of the subroutine? eg: program foobie; procedure dofoobie; var

[Lazarus] Lazarus and Application.ProcessMessages

2014-12-03 Thread Terry A. Haimann
I have a program that starts some background processes and then needs to go to sleep for 15 seconds or so and then come back and check on their statuses. So I used a loop like the following: EndTime := Now + EncodeTime(0, 0, 15, 0); While Now EndTime do Application.ProcessMessages; The

Re: [Lazarus] Lazarus and Application.ProcessMessages

2014-12-03 Thread Mattias Gaertner
On Wed, 03 Dec 2014 16:37:38 -0600 Terry A. Haimann te...@haimann.us wrote: I have a program that starts some background processes and then needs to go to sleep for 15 seconds or so and then come back and check on their statuses. So I used a loop like the following: EndTime := Now +

Re: [Lazarus] Lazarus and Application.ProcessMessages

2014-12-03 Thread Paul Breneman
On 12/03/2014 04:37 PM, Terry A. Haimann wrote: I have a program that starts some background processes and then needs to go to sleep for 15 seconds or so and then come back and check on their statuses. So I used a loop like the following: EndTime := Now + EncodeTime(0, 0, 15, 0); While Now

Re: [Lazarus] Lazarus and Application.ProcessMessages

2014-12-03 Thread m...@rpzdesign.com
Simple, TThread.Execute ; override ; Application process messages is SO Windows 3.1. md On 12/3/2014 5:51 PM, Paul Breneman wrote: On 12/03/2014 04:37 PM, Terry A. Haimann wrote: I have a program that starts some background processes and then needs to go to sleep for 15 seconds or so and