Skip to content

Commit c3f39f6

Browse files
committed
Minor improvement in FMX memo
1 parent 84b5084 commit c3f39f6

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

Demos/FMX/SimpleDemo/Unit1.pas

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ interface
66
System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants,
77
FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs,
88
FMX.Controls.Presentation, FMX.ScrollBox, FMX.Memo, FMX.StdCtrls,
9-
PythonEngine, PythonVersions, System.SyncObjs;
9+
PythonEngine, PythonVersions, System.SyncObjs, FMX.Memo.Types;
1010

1111
type
1212
TForm1 = class(TForm)
@@ -93,9 +93,14 @@ procedure TForm1.PythonInputOutputSendUniData(Sender: TObject;
9393
fOutputStream.Read(WS[1], Length(WS) * 2);
9494
fOutputStream.Size := 0;
9595
if (MemoOut.Lines.Count > 0) and (MemoOut.Lines[MemoOut.Lines.Count -1] <> '') then
96-
MemoOut.Lines.Add('');
97-
MemoOut.Text := MemoOut.Text + WS;
98-
MemoOut.GoToTextEnd;
96+
MemoOut.BeginUpdate;
97+
try
98+
MemoOut.Lines.Add('');
99+
MemoOut.Text := MemoOut.Text + WS;
100+
MemoOut.GoToTextEnd;
101+
finally
102+
MemoOut.EndUpdate;
103+
end;
99104
end;
100105
finally
101106
fCriticalSection.Leave;

0 commit comments

Comments
 (0)