Using layouts, I seem unable to add a widget (StaticRect) from code.
Even a button doesn't show up, whether I put it into the constructor or a click event:
Button button;
*this << button.SetLabel("Button").LeftPosZ(10, 64).TopPosZ(10, 24);
I suspect the layout hides everything under itself. Any way to do that?
1) StaticRect is not predefined in Layout manager. You have to add it as a "User class" (it is in the context menu).
Just set the CtrlType to StaticRect.
2) Order is important. StaticRect should come first, then StaticText on the ctrl list in the layout editor.
I have attached an example. It sets a backround rectangle and overlays a static text over it.