[Lazarus] TMemo flicker

Flávio Etrusco flavio.etrusco at gmail.com
Tue Apr 30 16:47:40 CEST 2013


On Tue, Apr 30, 2013 at 6:52 AM, Michael Van Canneyt
<michael at freepascal.org> wrote:
>
>
> On Tue, 30 Apr 2013, José Mejuto wrote:
>
>> El 30/04/2013 10:31, Michael Van Canneyt escribió:
>>
>>>> Your solution of course is mutch faster but I thought seeing the
>>>> progress is important for Jürgen.
>>>
>>> In that case the beginupdate/endupdate is a total waste of CPU.
>>>
>>
>> Hello,
>>
>> The problem is that the behavior changes with the use of begin/end update,
>> at least on Windows platform. Run attached code to test. Just create a form
>> and add a button and a Memo and link the button OnClick with this code
>> (better visible with a quite big Memo):
>>
 (code sample)
>> --------------------------------
>>
>> If Begin/End update is being used the vertical scroll bar position is not
>> updated, I do not know if this is expected :-?
>
>
> This i cannot say.
>
> What I can say is that, given the purpose of beginupdate/endupdate,
> in the above code, using beginupdate/endupdate is totally pointless.
>
> Not to mention that you should always use try/finally with
> beginupdate/endupdate
>
> BeginUpdate;
> try
>   // Do your thing
> finally
>   EndUpdate;
> end;
>
> Michael.
> --

José is indeed right. BeginUpdate fixes the back-and-forth scrolling
in Windows. Not sure whether I should take back my previous comment or
just say this is unexpected ;-)
On a side note, for displaying immediate changes in a control I'd
argue that "MyControl.Update()" is the correct thing to do (instead of
ProcessMessage). Not sure it works on all platforms though...

-Flávio




More information about the Lazarus mailing list