This type of thing Drives me crazy

I subclassed a canvas. I could put an instance on a window and all was fine… Then I subclassed THAT canvas subclass… When I tried to put THAT subclass on the window it was not recognized as a rectcontrol, and so was put on the shelf of the window!!!

I cant reproduce that in a quick trial here

Create the 2 canvas subclasses in a module with the second a subclass of the first… I did not realize that the parent subclass had to be in a module because I still had the problem when I moved them out of a module. (yet another bug)

In short if you create a canvas subclass in a module that will be OK… If you create a subclass of that canvas subclass, even outside of the module, when you try to put an instance of it on a window it winds up on the shelf.

I ran into this because I wanted the classes to share some non public stuff that would have been in teh module… can’t really do that conveniently now. Kind of blows up my design…

  • karen

I’m seeing this too as long as the scope of the Canvases are set to Public, not Global. If Global, it works fine.

Thanks… Did not think to set it to global.

BUT, this is just a visual thing. The fact that it’s on the shelf does not stop you from treating it like it’s in place and adding the events and code to it. When you run the project, it shows up as expected. The workaround is to change the Super to Canvas, position it properly, then change the Super back to what it should be. You can type in the coordinates if you prefer too.

This is code I may distribute if it comes out well so a that workaround would be a real negative.

I’d file the visual issues as a bug report about the IDE
Having to make the classes & subclasses global I’m honestly not sure (it’s late)
There may already be a report about that

I’m still seeing this issue. Subclass canvas > subclass that > insert into view > on the shelf. Trying the workaround, changing the Super back to iOSCanvas allows the control to be placed, but then the super cannot be changed back to the original. The original class when added does not include any Auto-layout options either.

This only happens in iOS projects, the same class in desktop projects works like a RectControl as expected. Anyone know of a possible solution?