Refresh the window after adding a button

Dear all and in particular Bertrand,

I have a simple TGMainFrame. At some point, after it is built and “mapped” and resized, I want to add an extra button. When I do so, the button appears when the mouse is moved above the window.

I would like the button to appear without the user moving his mouse. I tried many combination of of “MapSubWindows”, “Layout”, “NeedRedraw” etc but to no avail.

Any idea ?

Hi Barth,

Never seen such a behavior… On which platform is it happening?
And do you have a short piece if code reproducing the issue?

Cheers, Bertrand.

Hi Bertrand,

Thank you for your reply. By trying to make a minimal example I found what the problem was. I had forgotten to call gSystem->ProcessEvents() in my application loop.