Re: [Lazarus] What to replace Application.Processmessages with?

2020-11-01 Thread Mattias Gaertner via lazarus
On Sun, 01 Nov 2020 11:37:14 +0100 Bo Berglund via lazarus wrote: > On Sun, 1 Nov 2020 10:20:11 +0100 (CET), Michael Van Canneyt via > lazarus wrote: > > >> QUESTION: > >> Is there a way in code to check if Forms is used? > >> So it can be used instead of {$IFDEF NOGUI} > > > >normally > > >

Re: [Lazarus] What to replace Application.Processmessages with?

2020-11-01 Thread Bart via lazarus
On Sun, Nov 1, 2020 at 11:51 AM Michael Van Canneyt via lazarus wrote: > Well, then the IDE codetools have an issue. It's a known issue, not yet fixed. -- Bart -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/l

Re: [Lazarus] What to replace Application.Processmessages with?

2020-11-01 Thread Bo Berglund via lazarus
On Sun, 01 Nov 2020 11:48:54 +0100, Bo Berglund via lazarus wrote: >I created this command line program: > >program Test; > >begin > Writeln('I will test the TForm check now:'); > {$IF DECLARED(TForm)} >Writeln('TForm is declared...'); > {$ELSE} >Writeln('Apparently TForm not declared'

Re: [Lazarus] What to replace Application.Processmessages with?

2020-11-01 Thread Michael Van Canneyt via lazarus
On Sun, 1 Nov 2020, Bo Berglund via lazarus wrote: On Sun, 1 Nov 2020 10:20:11 +0100 (CET), Michael Van Canneyt via lazarus wrote: QUESTION: Is there a way in code to check if Forms is used? So it can be used instead of {$IFDEF NOGUI} normally {$IF DECLARED(Forms)} or {$IF DECLARED(TForm

Re: [Lazarus] What to replace Application.Processmessages with?

2020-11-01 Thread Michael Van Canneyt via lazarus
On Sun, 1 Nov 2020, Bo Berglund via lazarus wrote: should do the trick for you. A quick test: It seems like there is a problem with this... I added this to the end of a random function: {$IF DECLARED(TForm)} Application.ProcessMessages; {$ENDIF} Even though the project does not use Fo

Re: [Lazarus] What to replace Application.Processmessages with?

2020-11-01 Thread Bo Berglund via lazarus
On Sun, 1 Nov 2020 10:20:11 +0100 (CET), Michael Van Canneyt via lazarus wrote: >> QUESTION: >> Is there a way in code to check if Forms is used? >> So it can be used instead of {$IFDEF NOGUI} > >normally > >{$IF DECLARED(Forms)} >or >{$IF DECLARED(TForm)} > >should do the trick for you. > I cre

Re: [Lazarus] What to replace Application.Processmessages with?

2020-11-01 Thread Bo Berglund via lazarus
On Sun, 1 Nov 2020 10:20:11 +0100 (CET), Michael Van Canneyt via lazarus wrote: >> QUESTION: >> Is there a way in code to check if Forms is used? >> So it can be used instead of {$IFDEF NOGUI} > >normally > >{$IF DECLARED(Forms)} >or >{$IF DECLARED(TForm)} > >should do the trick for you. A quick

Re: [Lazarus] What to replace Application.Processmessages with?

2020-11-01 Thread Michael Van Canneyt via lazarus
On Sun, 1 Nov 2020, Bo Berglund via lazarus wrote: procedure AppProcessMessages; virtual; abstract; (no implementation) And ProcessAsyncCallQueue seems to be doing the job with pretty intricate code inside a CriticalSection shield. QUESTION: Is there a way in code to check if Forms is used?

Re: [Lazarus] What to replace Application.Processmessages with?

2020-11-01 Thread Bo Berglund via lazarus
On Mon, 26 Oct 2020 13:00:26 +0100 (CET), Michael Van Canneyt via lazarus wrote: >But I would create a routine > >Procedure HandleMainLoop; > >begin >{$IFDEF NOGUI} > CheckSynchronize; >{$ELSE} > Application.ProcessMessages; >{$ENDIF} >end; > >And call that both in GUI and NOGUI. I decided t

Re: [Lazarus] What to replace Application.Processmessages with?

2020-10-29 Thread Bo Berglund via lazarus
On Tue, 27 Oct 2020 21:25:55 +, Graeme Geldenhuys via lazarus wrote: >In the long term I would highly suggest converting that code / tasks >to multiple theads. From what you described, they sound like good >candidates for a thread based system. Yes, I agree, but... The code is pretty big an

Re: [Lazarus] What to replace Application.Processmessages with?

2020-10-28 Thread Michael Van Canneyt via lazarus
On Wed, 28 Oct 2020, Bo Berglund via lazarus wrote: On Mon, 26 Oct 2020 13:00:26 +0100 (CET), Michael Van Canneyt via lazarus wrote: On Tue, 13 Oct 2020, Bo Berglund via lazarus wrote: Now I wonder if I could put something else into the loops so that the main object of Application.Proce

Re: [Lazarus] What to replace Application.Processmessages with?

2020-10-28 Thread Bo Berglund via lazarus
On Mon, 26 Oct 2020 13:00:26 +0100 (CET), Michael Van Canneyt via lazarus wrote: > > >On Tue, 13 Oct 2020, Bo Berglund via lazarus wrote: > >> Now I wonder if I could put something else into the loops so that the >> main object of Application.Processmessages will be handled, namely to >> let even

Re: [Lazarus] What to replace Application.Processmessages with?

2020-10-28 Thread Michael Van Canneyt via lazarus
On Tue, 27 Oct 2020, Mattias Gaertner via lazarus wrote: On Mon, 26 Oct 2020 13:00:26 +0100 (CET) Michael Van Canneyt via lazarus wrote: [...] Procedure HandleMainLoop; begin {$IFDEF NOGUI} CheckSynchronize; {$ELSE} Application.ProcessMessages; {$ENDIF} end; And call that both in GU

Re: [Lazarus] What to replace Application.Processmessages with?

2020-10-27 Thread Mattias Gaertner via lazarus
On Mon, 26 Oct 2020 13:00:26 +0100 (CET) Michael Van Canneyt via lazarus wrote: >[...] > Procedure HandleMainLoop; > > begin > {$IFDEF NOGUI} >CheckSynchronize; > {$ELSE} >Application.ProcessMessages; > {$ENDIF} > end; > > And call that both in GUI and NOGUI. Application.ProcessMessage

Re: [Lazarus] What to replace Application.Processmessages with?

2020-10-27 Thread Graeme Geldenhuys via lazarus
On 13/10/2020 9:15 am, Bo Berglund via lazarus wrote: > The TTimer objects have been replaced by TFpTimer objects in the > ported code and this seems to work fine, whereas TTimer does not. That is the key part, using TFPTimer is thread based, so calling CheckSynchronized() would be the solution to

Re: [Lazarus] What to replace Application.Processmessages with?

2020-10-26 Thread Michael Van Canneyt via lazarus
On Tue, 13 Oct 2020, Bo Berglund via lazarus wrote: Now I wonder if I could put something else into the loops so that the main object of Application.Processmessages will be handled, namely to let event functions run as needed. Can I for example use CheckSynchronize in these loops? I.e. Applic

[Lazarus] What to replace Application.Processmessages with?

2020-10-26 Thread Bo Berglund via lazarus
I have been working some time to convert a rather big Delphi2007 Windows service application to a regular Linux program possible to run as a Linux systemd service. In Linux I was told that the application needs to be a regular program to run in a non-logged on setting on a Linux server (without des

[Lazarus] What to replace Application.Processmessages with?

2020-10-26 Thread Bo Berglund via lazarus
(Tried posting this via GMane but it does not appear so now sending email instead) I have been working some time to convert a rather big Delphi2007 Windows service application to a regular Linux program possible to run as a Linux systemd service. In Linux I was told that the application nee