Experiences with Container Controls containing Container Controls containing Container Controls

I am considering re-engineering what is currently a single container control containing a bunch of repeating items to contain several container controls, each of which would, in turn, contain several container controls.

My question is whether this is a “Bad Idea™” or not. Is it safe? Will it work? Will it exacerbate flickering issues on Windows builds? Other issues to consider?

Any thoughts appreciated.


I’ve had great success with multiple levels of embedded container controls on Cocoa. You can really structure some nice controls that way, by encapsulating smaller sub-controls within a larger concept control. As for Windows flicker issues, I have no idea. I suppose if you ran into problems, you could hack together some sort of double buffering effect with an Overlay window temporarily displaying a screenshot while things resize below it.

Yes. That’s exactly why I’m considering this. Doing it this way will much better align with the underlying object model of the application, and seems, in theory, a no-brainer. The big concern is whether it will work properly. Your experience, Jason, makes me think that the flicker issues are the main thing to worry about since this is a cross-platform project. Thanks for taking the time to share.


The IDE is such a thing :stuck_out_tongue:
It works reasonably to contains the complexity

This works great. Encapsulates everything nicely. I think I’ve got 3 levels of container controls (not in front of my project at the moment).

I think this is a Great Idea™ and should work just fine.

I do this with great success on my app.

Thanks to everyone for the input. I’ve got this mostly working now, and the flicker on Windows is an issue, but not a huge one. I am having trouble, though, with tabbing between the innermost nested container controls. I have an enclosing container control which contains 1-n instances of a sub-container, with each of those containing 1-n of the innermost container control I’m concerned about. It’s this innermost one that has the only fields that I want to tab between. One of them is a textField, and there are also several popupMenus.

In a situation where the user has added several of these innermost containers to one of the intermediate ones, I’d like her/him to be able to tab between each “row.” However, I can;t seem to get it to work properly. The closest I’ve gotten is to pretty much get the second through nth rows to work, but if I place an insertion point in the first row’s textField, and hit the tab key, nothing happens; I can;t tell where the focus is. AND, even this doesn’t really work as Shift-Tab requires two hits to tab back to the previous row.

Anybody have advice on how to get tabbing to work in this sort of construct?

BTW, I’ve tried to explicitly assign the value of the “.tabIndex” property every time the user adds or removes a containerControl “row.” I’ve also tried making all the popupMenus NOT accept tabs so that the textField is the only one in a row that does. No joy with with either, though…