Re: [Lazarus] TThread.Synchronize

2016-10-26 Thread Mattias Gaertner via Lazarus
On Wed, 26 Oct 2016 20:23:11 +0200 Sascha Hestermann via Lazarus wrote: > Am 26.10.2016 um 12:02 schrieb LacaK via Lazarus: > > Btw. when TTimer is executing OnTimer method, which does not finishes > > until next Interval is elapsed, is again called OnTimer ? Or next > > OnTimer is performed only

[Lazarus] osx cocoa panel no caption ?

2016-10-26 Thread Josh via Lazarus
Hi I have been struggling with cocoa and the non displaying of text when a font is changed programmatically. However after further testing; I also notice that the Tpanel component does not show the caption of the panel. Just drop a panel on a form, change the font to something bold and large so

Re: [Lazarus] TThread.Synchronize

2016-10-26 Thread Sascha Hestermann via Lazarus
Am 26.10.2016 um 12:02 schrieb LacaK via Lazarus: > Btw. when TTimer is executing OnTimer method, which does not finishes > until next Interval is elapsed, is again called OnTimer ? Or next > OnTimer is performed only when prior OnTimer finished ? Afaik TTimer periodically sends a message to the e

[Lazarus] TMouseinput mouse click.

2016-10-26 Thread Larry Dalton via Lazarus
I am running Lazarus 1.6 on Windows 7. I have one application where I need to move the mouse to a certain point on the screen and then do a mouseclick from the program. When I run the following procedure, procedure TMain_Form.Button1Click(Sender: TObject); var MousePos:Tpoint; MyMouse:TMouseInput

Re: [Lazarus] TThread.Synchronize

2016-10-26 Thread Michael Schnell via Lazarus
On 26.10.2016 12:02, LacaK via Lazarus wrote: you just could use TTimer. probably yes. I do not remember why I have used thread for it. May be I do not wanted dependency on ExtCtrls ... Btw. when TTimer is executing OnTimer method, which does not finishes until next Interval is elapsed, is

Re: [Lazarus] TThread.Synchronize

2016-10-26 Thread LacaK via Lazarus
Dňa 26.10.2016 o 11:17 Michael Schnell via Lazarus napísal(a): On 26.10.2016 07:57, LacaK via Lazarus wrote: procedure TRefreshFileListThread.Execute; begin while not Terminated do begin Synchronize(@MyForm.UpdateFileList); // UpdateFileList is method which clears listbox and then adds fi

Re: [Lazarus] TThread.Synchronize

2016-10-26 Thread Michael Schnell via Lazarus
On 26.10.2016 07:57, LacaK via Lazarus wrote: procedure TRefreshFileListThread.Execute; begin while not Terminated do begin Synchronize(@MyForm.UpdateFileList); // UpdateFileList is method which clears listbox and then adds files in given shared folder Sleep(1); end; This only m

Re: [Lazarus] TThread.Synchronize

2016-10-26 Thread LacaK via Lazarus
Big Thanks to all. Now I understand what is happening ... probably I wil use critical section to block access from thread when code in main thread is performed ... -Laco. ShowModal() for a modal form will call it. [...] I did test in Delphi and Delphi seems also perform synchronize upon Sho

Re: [Lazarus] TThread.Synchronize

2016-10-26 Thread Mattias Gaertner via Lazarus
On Wed, 26 Oct 2016 09:49:44 +0200 LacaK via Lazarus wrote: > >>> ShowModal() for a modal form will call it. >[...] > I did test in Delphi and Delphi seems also perform synchronize upon > ShowModal Yes. > > Nowhere is it stated or guaranteed that synchronisation cannot happen > > in a GUI

Re: [Lazarus] TThread.Synchronize

2016-10-26 Thread LacaK via Lazarus
ShowModal() for a modal form will call it. Ah really? It happens in my application! Then that is your problem. :-))) But is it correct behavior ? IMO it is against thread safety, which should Synchronize guarantee! The two issues are completely unrelated. The current behaviour is co