We found a problem in an application the other day where using Message() in ThisWindow.Open would cause the window to display before the Resizer had actually done it’s thing and put the controls in the correct position. Whilst not being a critical problem it sure made things look awful.

Here is why and a way to handle the situation:

Normally the Resizer does its initial resizing of the window controls when EVENT:DoResize first occurs. If you check the ABWINDOW.CLW you can see where the WindowManager Post()’s this event for the Resizer, in the WindowManager.TakeEvent method:

The problem here is that when ThisWindow.Open() is called (triggered by EVENT:OpenWindow, see WindowManager.TakeWindowEvent ) the EVENT:DoResize has not yet actually even been fired let alone processed.


On a window with few controls and no messages or other modal events occurring between EVENT:OpenWindow and EVENT:Sized this would not be an obvious problem. The window would redraw so fast as to make this practically invisible. I have not checked but in fact the “PROP:DeferMove” may also come into play.

In this case however I think we need to try and remember that if we are going to do anything “modal” like popping a message in ThisWindow.Open then we also need to ensure that we manually call the Resizer.Resize beforehand (if the window in question has one!).
Oh, and a “Display()” is also needed to make the effect of the Resizer properly visible. This would be the full code:

So hopefully this has been of help or perhaps it just confirms something you already knew?

Enjoy!