<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman,new york,times,serif;font-size:12pt"><div>That worked perfectly :-)<br>Thank you very much for your help, and thank you everybody else for the replies.<br></div><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"><br><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"><font size="2" face="Tahoma"><hr size="1"><b><span style="font-weight: bold;">From:</span></b> Lyle Johnson &lt;lyle@lylejohnson.name&gt;<br><b><span style="font-weight: bold;">To:</span></b> fxruby-users@rubyforge.org<br><b><span style="font-weight: bold;">Sent:</span></b> Sunday, 25 January, 2009 20:55:27<br><b><span style="font-weight: bold;">Subject:</span></b> Re: [fxruby-users] Overriding default GUI colors<br></font><br><br><div><div>On Jan 24, 2009, at 6:26 AM, James Hibbard wrote:</div><br
 class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><div><div style="margin: 0px; font-family: 'times new roman','new york',times,serif; font-size: 12pt;"><div style="margin: 0px;">I wrote a GUI using FXRuby under WinXP.<br>I then upgraded to Vista, installed Ruby (and thus by default FXRuby) and ran my GUI.<br>It was then that I noticed that the colours have gone weird.<span class="Apple-converted-space">&nbsp;</span><br>The main user interface is now white (the default colour that Vista uses), but all of the data targets and tables have remained beige (RGB 236, 233, 216).<br>Of course one can individualy declare
 a white background colour for each of these widgets, but then it looks garish if run on XP or Linux.<br>I'm looking for a setting I can apply to make the colour for the application uniform and overide the system default.<br>I already tried such things as app.backColour = FXRGB(236, 233, 216).</div></div></div></span></blockquote><div><br></div>If you didn't build FOX from source code, you probably don't have the FOX Control Panel application installed, and so you'll need to change these default colors in your application code.</div><div><br></div><div>The trick, however, is to change the color values after the FXApp's init() method gets called, but before you create any of your application's widgets:</div><div><br></div><div><span class="Apple-tab-span" style="white-space: pre;">        </span>app = FXApp.new</div><div><span class="Apple-tab-span" style="white-space: pre;">        </span>app.init(ARGV)</div><div><span class="Apple-tab-span" style="white-space: pre;">
        </span>#<br></div><div><span class="Apple-tab-span" style="white-space: pre;">        </span># Change default colors here, e.g.<br></div><div><span class="Apple-tab-span" style="white-space: pre;">        </span>#&nbsp;<span class="Apple-tab-span" style="white-space: pre;">        </span>app.backColor = FXRGB(236, 233, 216)<br></div><div><span class="Apple-tab-span" style="white-space: pre;">        </span>#<br></div><div><span class="Apple-tab-span" style="white-space: pre;">        </span>main_window = FXMainWindow.new(app, ...)<br></div><div><span class="Apple-tab-span" style="white-space: pre;">        </span>app.create</div><div><span class="Apple-tab-span" style="white-space: pre;">        </span>app.run</div><div><br></div><div>When you construct a widget (like an FXMainWindow), it copies the colors from FXApp, and so if you haven't changed them by that point you have to go make changes on a widget-by-widget basis (which is a pain). Also, note that in many FXRuby applications you won't see
 FXApp#init called explicitly, because it gets called automatically for you if you don't need it.</div><div><br></div><div>Hope this helps,</div><div><br></div><div>Lyle</div></div></div></div><br>



      </body></html>