Create any OpenGLSurface, put a msgbox in the resized event and a message in the open event. The resize will trigger it’s msgbox first? Why is this the case?
Also the window the surface is in, it’s open event will trigger next. So do children elements always have there ‘open’ events triggered first?
This is important because I need to reliably initialize variables before the resize commands can be allowed to be run.
Note: I have the openGLSurface set to lock to the sides of the window so as it resizes it will also.
I’ve seen things like that, and have taken to coding defensively:
Control.Open
mOpened = true
Control.Resized
if not mOpened then return
I think it’s pretty arguable that Resized before Opened is a bug, though I think we’ve also been told “don’t count on control event order” at various times as well.
In my Xojo 101, I was told that the event.open() always come after the constructor(), than the rest, so, if a resize() occurs before an open(), for me it should be a bug.
[quote=36808:@Rick A.]Put those lines in the proper places in the events instead of a msgbox, and check if the order is consistent in the message pane:
Okay I’m glad some people agree this is a bug, I thought I was going crazy. I noticed in objective-c coding that I also do on the side with xCode, this same error occurs where resize events run before the open events on the nib files which leads me to believe this may be a mac error?
I have not tested to see if this happens also on the windows side? does it anyone?
If it happens in obj-c, too, then it may not classify so much as “bug”, but as “gotcha that you need to be aware of and code for”. If your code depends on open occuring before resize, then use a flag/flags to inform you.