So yesterday, I had a complete nightmare situation.
Xojo was running slowly; I had been debugging, had multiple projects open and gone over my 16GB memory limit on my machine. So I quit Xojo (and a bunch of other application) and re-opened. Continued working on my code and then ran the project.
None of the controls on a container control would show.
In this project all the controls are custom canvases and are placed on a canvas which is placed in a NSScrollView class. I even added regular controls to the canvas, those wouldn’t display. I then added regular controls to the container control and they still wouldn’t show.
I made the scrollview invisible, and continued to strip down my control and remove all declares on the window, still nothing…
I’m using a lot of customized animation and while I know that my code for the animation has a limited, I even removed all animation from the controls.
Eventually I found the problem, it was a computed property had started firing before the open event, while there’s code in the scrollview to protect against this, it was still somehow corrupting the entire window.
It was only when I added a property to the continaerControl called “isOpen” and was set to true on the Open event of the window (with the computed properties simply bailing when it’s false), did I finally get somewhere. I added “System.debuglog” functions all over the place, and that’s how I figured it out.
We’re talking about 7 hours it took for me to figure this out, I was very very frustrated during the entire process.
As far I can see, there should be only one reason as to why Xojo should fire a computed property (on a control), and it should occur after the Open event.
#1 The property is available in the inspector.
Otherwise it should not fire until it’s called within code that we write.