1. Lukas Kluge
  2. PowerBuilder
  3. Thursday, 25 June 2020 10:00 AM UTC



I'm using PowerBuilder 2017 R3.

We have an issue that our windows flicker alot when opening them due to different operations that are being performed (changing texts based on database entries, showing/hiding certain objects based on user privileges etc).

I'm tasked with trying to reduce those flickers/changes so that the window is basically ready to use when the user sees it. I understand I can use SetRedraw() to apply all changes at once. The way I see it I have to disable and enable redraw for every object on the window, is that correct or is there any way to just do it for all objects?

Also, many of these windows are sheet windows, is there really no way to make sheet windows invisible until they are fully loaded? Neither w_window.visible=false nor w_window.hide() seem to work.

I'm just trying to find out if there is any "best practice" so to speak when it comes to preventing flickering.


Thank you!

John Fauss Accepted Answer Pending Moderation
  1. Thursday, 25 June 2020 14:05 PM UTC
  2. PowerBuilder
  3. # 1

Hi, Lukas -

The visual effects of POST-ing events can be confusing.

Posted events do not execute at the end of an event script, but after completion of the original event chain. POST-ing an event adds a new event to the Windows (operating system) event queue that is separate from the event that is POST-ing the new event "message". Because your app is built upon the PFC, in this case the PFC's pfc_PostOpen event runs after completion of the Open event. As Rene points out, PB displays the window after the Open event completes... and this occurs before the pfc_PostOpen event runs.

This is why issuing SetRedraw() from the pfc_PostOpen event seemingly has no or little effect and why you continue to see "flicker". If you really want to try to minimize "flicker", then I suggest you experiment with:

  1. setting This.SetRedraw(False) at the beginning of the window's Open event. You may need to override the window's ancestor Open script(s).
  2. Issue SetRedraw(False) in the override script, then invoke the ancestor script(s) via Call::Super.
  3. Invoke, even POST(!) the This.SetRedraw(True) function call at the end of the window's pfc_PostOpen event to delay it being run as long as possible.

Please also realize the if the window contains visual user objects that self-initialize via POST-ed events, this may complicate the timing of when these objects become visible.

HTH, Regards - John

There are no comments made yet.
René Ullrich Accepted Answer Pending Moderation
  1. Thursday, 25 June 2020 10:22 AM UTC
  2. PowerBuilder
  3. # 2

Hi Lukas,

have you tried to call the SetRedraw function for the window instead of for each control?

The best place to configure the window is the window open event. The window is invisible until the open event finished.



  1. Lukas Kluge
  2. Thursday, 25 June 2020 10:31 AM UTC

I tried that at first, but it didn't seem to work.

But I just tried again, setredraw(true) in pfc_postopen() and showed a messagebox afterwards. After the messagebox there was still flickering and changes, so it seems like there are changes even after the postopen event...

So I guess I will have to look into that.

Thank you!
  1. Helpful
  1. Chris Pollach @Appeon
  2. Thursday, 25 June 2020 15:51 PM UTC
Hi Lukas;

Are you using the PFC framework version that matches PB 2017R3 or is this an old copy of the framework that has just been migrated forward from an old PB release to release, to release ...?

FYI: https://github.com/OpenSourcePFCLibraries

Regards ... Chris
  1. Helpful
There are no comments made yet.
  • Page :
  • 1

There are no replies made for this question yet.
However, you are not allowed to reply to this question.