Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » Look and Chameleon Technology » How to change window background?
How to change window background? [message #37952] Sat, 24 November 2012 15:02 Go to next message
lectus is currently offline  lectus
Messages: 329
Registered: September 2006
Location: Brazil
Senior Member
How can I change the window background color with Chameleon?

Thanks
Re: How to change window background? [message #37956 is a reply to message #37952] Sat, 24 November 2012 20:36 Go to previous messageGo to next message
bushman is currently offline  bushman
Messages: 134
Registered: February 2009
Experienced Member
Two alternatives:

GUI_APP_MAIN {
  // Define the colors you want to your window by calling the
  // many ::SColorXXX_Write(Color) functions before running
  // your app
  ::SColorFace_Write(Color(r, g, b));
  ::SColorText_Write(Color(r, g, b));
  ...
  MyApp().Run();
}


or override your window Paint method
  class MyApp : public TopWindow
  {
   public:
     MyApp() {}

     // Paint override
     void Paint(Draw& w) {
        w.DrawRect(GetSize(), Color(r, g, b)); // <= enter your background color here
     }
  };

GUI_APP_MAIN
{
  MyApp().Run();
}


Re: How to change window background? [message #37962 is a reply to message #37956] Sun, 25 November 2012 09:32 Go to previous message
koldo is currently offline  koldo
Messages: 3355
Registered: August 2008
Senior Veteran
Hello Lectus

You can also check StaticImage in Controls4U. It has a UseAsBackground() method that sets the image as background of the parent control.

You will see that it is very simple.


Best regards
IƱaki
Previous Topic: undesired behavior using custom styled MenuBar
Next Topic: look of ctrl with styled horz and vert scrollbars
Goto Forum:
  


Current Time: Fri Mar 29 11:31:54 CET 2024

Total time taken to generate the page: 0.00454 seconds