I have several ‘pages’ that have been implemented using ContainerControl. That is, a variety of other controls have been put onto a ContainerControl, and these are put on a window which shows/hides them as needed.
The resize event of the page calls a layout method that arranges the various controls that are contained.
Setting either page.Width or page.Height triggers a resize event. Since both are usually set at the same time, there will be two layout calls when there only needs to be one.
In order to eliminate the redundant call to the layout method, I tried subclassing ContainerControl, so that I could add a property to all of these pages. Also this seemed a good way to set DoubleBuffer etc as is best practice for Windows.
So I inserted a class, then changed its superclass to ContainerControl (typing “ContainerControl” into the textbox in the inspector). The icon in the contents list changed to a ContainerControl icon, BUT there was no window shown. I named this class PageCtl. I then set the superclass of all of my pages to PageCtl.
Xojo was quite happy about this, did not complain. The redraw problem was fixed. The only problem was, the background was not being drawn for the pages.
Then I tried something different. I dragged a ContainerControl from the Library into the contents. Added the required property etc, and renamed that to PageCtl. Now the code would not compile, reporting that it could not subclass a window.
This of course makes no sense at all. In both cases, the superclass says ContainerControl, but the behaviour is different.
I think the answer for me will be to use a Canvas as a container…but this is a bug. Also it begs the question, if the superclass was not ContainerControl, then what was it?
This is on OSX El Capitan with 2016r3.