# \- background color problem for FXCombobox

**URL:** <https://www.ruby-forum.com/t/background-color-problem-for-fxcombobox/97250>\
**Category:** Ruby\
**Created:** [July 5, 2006, 11:20pm UTC](https://www.ruby-forum.com/t/background-color-problem-for-fxcombobox/97250 "2006-07-05T23:20:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [July 5, 2006, 11:20pm UTC](https://www.ruby-forum.com/t/background-color-problem-for-fxcombobox/97250/1 "2006-07-05T23:20:22Z")

</div>

Dear all,

this is a cross-post from FXRuby-users’ mailing list. Since an earlier  
post  
from somebody else today got a response on the Ruby mailing list, which  
hadn’t got a response on a more restricted list, I felt encouraged to  
try  
again, too 🙂

How do you set the background color of a FXCombobox ?  
I have a Combobox, which should have a white background  
color, yet it somewhat strangely inherits the gray  
color of the frame it sits in.  
I have tried to correct this by setting

p = $settingsFrame  
p.recursive{|w|

# w.baseColor=STD\_BACK\_COLOR

next if w.kind\_of? TextField  
next if w.backColor==HEADER\_COLOR  
if /ComboBox/.match(w.type.to\_s)  
w.baseColor=WHITE\_BACK\_COLOR  
w.backColor=WHITE\_BACK\_COLOR

else  
w.backColor=STD\_BACK\_COLOR  
end  
}

for WHITE\_BACK\_COLOR=FXRGB(255,255,255),  
and STD\_BACK\_COLR=FXRGB(128,128,128)

but this changes the background color from gray to white only if I  
click on  
the combobox to show a dropdown of them. Then , everything becomes  
white, but after that, it turns to gray again.

Thank you for your help,

Axel

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [July 5, 2006, 11:39pm UTC](https://www.ruby-forum.com/t/background-color-problem-for-fxcombobox/97250/2 "2006-07-05T23:39:21Z")

</div>

On 7/5/06, removed\_email\_address@domain.invalid [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> How do you set the background color of a FXCombobox?

You’d probably need to change the background color of the FXTextField  
widget that’s a child of the combo box.
