No more subclassing DesktopContainers?

Years ago I made an app where the UI used subclasses of a desktopContainer class to create a dynamic layout… sweet. Now the user would like an update.

… but this is no longer supported, right ?

I can work around it, but its tedious…

Go to the Library and right-click on “Container” to create a DesktopContainer subclass. Add your code to this subclass. Next, click the “Add” button in the IDE toolbar, choose “Container” and set its Super to your custom Container subclass.

1 Like

That’s exactly what I tried in an empty (new) project. The IDE will not allow the super of the second container to be anything other than desktopcontainer.

Please watch the screen record with the steps.

https://imgur.com/a/14geOIv

1 Like

Right, you can’t inherit UI. There are things you can do however…

If your goal is to just inherit code from a super, you can add a generic class to the navigator, set it’s super to DesktopContainer and add your common code there. From then on, you drag a container from the library and then set the Super to the class you created above.

If you want to “inherit” UI, you’ll need to visually embed containers within containers.

Martin - Thankyou ! THAT’s interesting.

Using your method - creating a DesktopContainer by selecting the window, the control-clicking that icon under the IDE Library of Controls, this creates a DesktopContainer that can indeed be subclassed, as shown in your screen recording.

However I never used that method !!! I’ve always created a DesktopContainer class using the + button at top left of the IDE - but - if I control-click on it, New Subclass is not an option in the popup menu of the IDE.

So not all DesktopContainers are equal - and some are more equal than others !

@Greg - I do nest containers in containers in containers - and dynamically done in code.