U++ framework
Do not panic. Ask here before giving up.

Home » U++ Library support » U++ Widgets - General questions or Mixed problems » Background color of StaticText or EditString
Re: Background color of StaticText or EditString [message #54807 is a reply to message #54806] Thu, 17 September 2020 14:40 Go to previous messageGo to previous message
Oblivion is currently offline  Oblivion
Messages: 1281
Registered: August 2007
Senior Contributor
Hello aquilarubra,


Quote:
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.

Best regards,
Oblivion

  • Attachment: TestApp.zip
    (Size: 1.46KB, Downloaded 325 times)


 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Changing mouse icon with MouseEvent
Next Topic: Add Button crashes program on start
Goto Forum:
  


Current Time: Sat Sep 19 09:06:37 GMT+2 2026

Total time taken to generate the page: 0.00658 seconds