On Jan 7, 2008, at 11:30 AM, Mattias Gaertner wrote:

On Mon, 7 Jan 2008 10:27:39 +0100
Damien Gerard <[EMAIL PROTECTED]> wrote:


Hi !

I have a lot of controls created on the fly, with a lot of Resize
(Anchors, width/height) and as far I remember I had to call
Application.ProcessMessages with Delphi to have proper resizes.

However in Lazarus I don't know when I have to call for more
efficiency it and if it is really necessary.

(Those resize happen during OnClick events too)

Application.ProcessMessages is only needed if your program process a
lot of data taking a long time or waits for another process. Otherwise
the LCL calls Application.ProcessMessages automatically.


Great.


To reduce overhead use

procedure TFrom.Button1Click(Sender: TObject);
begin
 DisableAlign;
 try
   .. create controls or change several properties ..
 finally
   EnableAlign;
 end;
end;



I had completely forgotten about this. It is better with that thanks !
However I have now minor layout problems. I will investigate.




--
Damien Gerard
[EMAIL PROTECTED]

People who used magic without knowing what they were doing usually came to a sticky end. All over the entire room, sometimes.
    -- (Terry Pratchett, Moving Pictures)



_________________________________________________________________
    To unsubscribe: mail [EMAIL PROTECTED] with
               "unsubscribe" as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives

Reply via email to