Re: Default Background Color

Michael J M Thomson <[email protected]> Wed, 09 Mar 2005 15:38:20 +1100
Newsgroups gmane.comp.gnome.gnomemm,gmane.comp.gnome.gtkmm
Organization Little, if any.
Message-ID <[email protected]>
Andy Ma wrote:
 > Besides using a RC file, can this set bg done in the code?
 > is using a RC file the only way?
 >

You could do what Paul Davis suggested,
 >   canvas->set_name ("MyNameForTheCanvas")
 >
 > and then in the applications' RC file:
 >
 > style "main_canvas_area"
 > {
 >	bg[NORMAL] = { 0.89, 0.88, 0.91 }
 >	bg[ACTIVE] = { 0.89, 0.88, 0.91 }
 >	bg[INSENSITIVE] = { 0.89, 0.88, 0.91 }
 >	bg[SELECTED] = { 0.89, 0.88, 0.91 }
 >	bg[PRELIGHT] = { 0.89, 0.88, 0.91 }
 > }
 >
 > widget "*MyNameForTheCanvas" style "main_canvas_area"

but put the RC definition in your code:

   Gtk::RC::parse_string(
     "style 'my_canvas' {"
     "  bg[NORMAL] = { ... }"
     ...
   );