Re: [Lazarus] animated splash screen for lengthy operation, works with windows, doesn't with linux

2023-03-27 Thread Michael Van Canneyt via lazarus
On Tue, 28 Mar 2023, Luca Olivetti via lazarus wrote: El 28/3/23 a les 0:01, Michael Van Canneyt ha escrit: My bad, I made a typo, it should have been MyException:=ExceptionClass(ut.FatalException).ClassType).Create(Exception(ut.FatalException).message) Thank you. Actually it is

Re: [Lazarus] animated splash screen for lengthy operation, works with windows, doesn't with linux

2023-03-27 Thread Luca Olivetti via lazarus
El 28/3/23 a les 0:45, Luca Olivetti via lazarus ha escrit: El 28/3/23 a les 0:01, Michael Van Canneyt ha escrit: My bad, I made a typo, it should have been MyException:=ExceptionClass(ut.FatalException).ClassType).Create(Exception(ut.FatalException).message) Thank you. Actually it is

Re: [Lazarus] animated splash screen for lengthy operation, works with windows, doesn't with linux

2023-03-27 Thread Luca Olivetti via lazarus
El 28/3/23 a les 0:01, Michael Van Canneyt ha escrit: My bad, I made a typo, it should have been MyException:=ExceptionClass(ut.FatalException).ClassType).Create(Exception(ut.FatalException).message) Thank you. Actually it is

Re: [Lazarus] animated splash screen for lengthy operation, works with windows, doesn't with linux

2023-03-27 Thread Michael Van Canneyt via lazarus
On Mon, 27 Mar 2023, Luca Olivetti via lazarus wrote: El 27/3/23 a les 17:26, Luca Olivetti via lazarus ha escrit: El 27/3/23 a les 16:50, Michael Van Canneyt ha escrit: Ehm. In case of an exception, ut will never be freed ? That's what I said. I was looking for a way to free it *and*

Re: [Lazarus] animated splash screen for lengthy operation, works with windows, doesn't with linux

2023-03-27 Thread Luca Olivetti via lazarus
El 27/3/23 a les 17:26, Luca Olivetti via lazarus ha escrit: El 27/3/23 a les 16:50, Michael Van Canneyt ha escrit: Ehm. In case of an exception, ut will never be freed ? That's what I said. I was looking for a way to free it *and* raise the exception in the context of the main thread. If

Re: [Lazarus] animated splash screen for lengthy operation, works with windows, doesn't with linux

2023-03-27 Thread Luca Olivetti via lazarus
El 27/3/23 a les 16:50, Michael Van Canneyt ha escrit: Ehm. In case of an exception, ut will never be freed ? That's what I said. I was looking for a way to free it *and* raise the exception in the context of the main thread. If I move the ut.free before the raise, the exception has already

Re: [Lazarus] animated splash screen for lengthy operation, works with windows, doesn't with linux

2023-03-27 Thread Michael Van Canneyt via lazarus
On Mon, 27 Mar 2023, Luca Olivetti via lazarus wrote: El 27/3/23 a les 16:13, Michael Van Canneyt via lazarus ha escrit: On Mon, 27 Mar 2023, Luca Olivetti via lazarus wrote: El 27/3/23 a les 11:59, Luca Olivetti via lazarus ha escrit: [*] instead of opening the query I spawn a thread

Re: [Lazarus] animated splash screen for lengthy operation, works with windows, doesn't with linux

2023-03-27 Thread Luca Olivetti via lazarus
El 27/3/23 a les 16:13, Michael Van Canneyt via lazarus ha escrit: On Mon, 27 Mar 2023, Luca Olivetti via lazarus wrote: El 27/3/23 a les 11:59, Luca Olivetti via lazarus ha escrit: [*] instead of opening the query I spawn a thread that opens it, wait for it to finish while executing

Re: [Lazarus] animated splash screen for lengthy operation, works with windows, doesn't with linux

2023-03-27 Thread Michael Van Canneyt via lazarus
On Mon, 27 Mar 2023, Luca Olivetti via lazarus wrote: El 27/3/23 a les 11:59, Luca Olivetti via lazarus ha escrit: [*] instead of opening the query I spawn a thread that opens it, wait for it to finish while executing Application.ProcessMessages and eventually reraise the exception that

Re: [Lazarus] animated splash screen for lengthy operation, works with windows, doesn't with linux

2023-03-27 Thread Luca Olivetti via lazarus
El 27/3/23 a les 15:55, Jean SUZINEAU via lazarus ha escrit: Le 27/03/2023 à 14:40, Luca Olivetti via lazarus a écrit : The problem here is, if AProc raises an exception, I cannot free the thread causing a leak. May be you can create a new exception class specifically for ExecWithSplash,

Re: [Lazarus] animated splash screen for lengthy operation, works with windows, doesn't with linux

2023-03-27 Thread Luca Olivetti via lazarus
El 27/3/23 a les 15:40, Mattias Gaertner via lazarus ha escrit: procedure ExecWithSplash(AProc:TThreadProc); var wf:TWaitForm; ut:TExecInThread; begin Wf:=TWaitForm.Create(Application); WF.Show; ut:=TExecInThread.create(AProc); while not ut.Finished

Re: [Lazarus] animated splash screen for lengthy operation, works with windows, doesn't with linux

2023-03-27 Thread Jean SUZINEAU via lazarus
Le 27/03/2023 à 14:40, Luca Olivetti via lazarus a écrit : The problem here is, if AProc raises an exception, I cannot free the thread causing a leak. May be you can create a new exception class specifically for ExecWithSplash, instantiate it and put all the information of ut.FatalException

Re: [Lazarus] animated splash screen for lengthy operation, works with windows, doesn't with linux

2023-03-27 Thread Mattias Gaertner via lazarus
On Mon, 27 Mar 2023 14:40:26 +0200 Luca Olivetti via lazarus wrote: > El 27/3/23 a les 11:59, Luca Olivetti via lazarus ha escrit: > > > [*] instead of opening the query I spawn a thread that opens it, > > wait for it to finish while executing Application.ProcessMessages > > and eventually

Re: [Lazarus] animated splash screen for lengthy operation, works with windows, doesn't with linux

2023-03-27 Thread Luca Olivetti via lazarus
El 27/3/23 a les 11:59, Luca Olivetti via lazarus ha escrit: [*] instead of opening the query I spawn a thread that opens it, wait for it to finish while executing Application.ProcessMessages and eventually reraise the exception that was generated inside the thread. Speaking of which, I

Re: [Lazarus] animated splash screen for lengthy operation, works with windows, doesn't with linux

2023-03-27 Thread Luca Olivetti via lazarus
El 27/3/23 a les 12:07, Giuliano Colla ha escrit: In a similar scenario my solution has been that of an horrible hack. It's a hack, but it works. I've put in a corner of my window a label of just one character, and, with a frequent timer (200 ms in my case) I update the caption. I'm using a

Re: [Lazarus] animated splash screen for lengthy operation, works with windows, doesn't with linux

2023-03-27 Thread Giuliano Colla via lazarus
Il 27/03/23 09:46, Luca Olivetti via lazarus ha scritto: Hello, I'd like to show a splash screen with an animation during a lengthy operation. I cannot rely on a timer to show the animation since the message loop isn't running, so I'm using a thread to directly paint over the form, i.e.:

Re: [Lazarus] animated splash screen for lengthy operation, works with windows, doesn't with linux

2023-03-27 Thread Luca Olivetti via lazarus
El 27/3/23 a les 11:06, Sven Barth via lazarus ha escrit: Luca Olivetti via lazarus > schrieb am Mo., 27. März 2023, 10:34: El 27/3/23 a les 10:13, Jean SUZINEAU via lazarus ha escrit: > > Le 27/03/2023 à 09:46, Luca Olivetti via lazarus a

Re: [Lazarus] animated splash screen for lengthy operation, works with windows, doesn't with linux

2023-03-27 Thread Sven Barth via lazarus
Luca Olivetti via lazarus schrieb am Mo., 27. März 2023, 10:34: > El 27/3/23 a les 10:13, Jean SUZINEAU via lazarus ha escrit: > > > > Le 27/03/2023 à 09:46, Luca Olivetti via lazarus a écrit : > >> procedure TUpdateThread.Execute; > >> begin > >> while not Terminated do > >> begin > >>

Re: [Lazarus] animated splash screen for lengthy operation, works with windows, doesn't with linux

2023-03-27 Thread Luca Olivetti via lazarus
El 27/3/23 a les 10:34, Luca Olivetti via lazarus ha escrit: El 27/3/23 a les 10:13, Jean SUZINEAU via lazarus ha escrit: Le 27/03/2023 à 09:46, Luca Olivetti via lazarus a écrit : procedure TUpdateThread.Execute; begin   while not Terminated do   begin     FWaitForm.ShowProgress;    

Re: [Lazarus] animated splash screen for lengthy operation, works with windows, doesn't with linux

2023-03-27 Thread Luca Olivetti via lazarus
El 27/3/23 a les 10:13, Jean SUZINEAU via lazarus ha escrit: Le 27/03/2023 à 09:46, Luca Olivetti via lazarus a écrit : procedure TUpdateThread.Execute; begin   while not Terminated do   begin     FWaitForm.ShowProgress;     Sleep(30);   end; end; Usually I use TThread.Synchronize to ensure

Re: [Lazarus] animated splash screen for lengthy operation, works with windows, doesn't with linux

2023-03-27 Thread Jean SUZINEAU via lazarus
Le 27/03/2023 à 09:46, Luca Olivetti via lazarus a écrit : procedure TUpdateThread.Execute; begin   while not Terminated do   begin     FWaitForm.ShowProgress;     Sleep(30);   end; end; Usually I use TThread.Synchronize to ensure that the graphic code is run by the main thread. But it

[Lazarus] animated splash screen for lengthy operation, works with windows, doesn't with linux

2023-03-27 Thread Luca Olivetti via lazarus
Hello, I'd like to show a splash screen with an animation during a lengthy operation. I cannot rely on a timer to show the animation since the message loop isn't running, so I'm using a thread to directly paint over the form, i.e.: WaitForm.Show; Application.ProcessMessages; ... procedure