* * *

Author Topic: [Solved] Form update  (Read 319 times)

madref

  • Sr. Member
  • ****
  • Posts: 460
  • ..... A day not Laughed is a day not Lived !!
    • Nursing With Humour
[Solved] Form update
« on: June 14, 2018, 12:49:11 am »
Due to my programming is have a very nasty screen flicker when I am updating my screen.
I have search the forum but I can't find any relevant topics on this (maybe it's just me).


But is it possible to 'disable' the form , update your form and then show the updated form?
« Last Edit: June 14, 2018, 11:24:37 am by madref »
You treat a disease, you win, you lose.
You treat a person and I guarantee you win, no matter the outcome.

Lazarus 1.8.2 / FPC 3.0.4
Lazarus Trunk / FPC Trunk
Mac OS X El Capitan

lainz

  • Hero Member
  • *****
  • Posts: 2717
  • I'm coding :)
    • Lainz
Re: Form update
« Reply #1 on: June 14, 2018, 12:50:57 am »
No, is not just you. If you change a lot of UI elements it becomes slow.

You can try using BeginUpdate and EndUpdate in those controls that has it.

Another way is to Enabled := False, then in a try.. finally part enable it again.

madref

  • Sr. Member
  • ****
  • Posts: 460
  • ..... A day not Laughed is a day not Lived !!
    • Nursing With Humour
Re: Form update
« Reply #2 on: June 14, 2018, 11:24:22 am »
After fooling around with my code I came to the following solution.
The parts that flickered the most I put in a GroupBox or Panel.
I disabled the visibility, updated the components and then put the visibility back.
No more flickering from updating components.


It's not ideal, but effective.
You treat a disease, you win, you lose.
You treat a person and I guarantee you win, no matter the outcome.

Lazarus 1.8.2 / FPC 3.0.4
Lazarus Trunk / FPC Trunk
Mac OS X El Capitan

lainz

  • Hero Member
  • *****
  • Posts: 2717
  • I'm coding :)
    • Lainz
Re: [Solved] Form update
« Reply #3 on: June 14, 2018, 07:05:00 pm »
I understand that. I had to do the same for a project that heavily uses UI.

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus