[fxruby-users] FXCombobox -set background color

Axel Etzold AEtzold at gmx.de
Sun Jul 9 10:50:02 EDT 2006


Dear Lyle,

thank you for your response. Your code works fine.
My problem is shown in the attached screenshot 
of my application. There's a Combobox open, the pane
is in white color, but the first option in it is gray,
like the background. This seems to be because
recursively, labels, textfields, comboboxes get added,
and I set their background color in each iteration step.
Now, it seems that the background is everything but the
newly added textfield,combobox or whatever.
I can work around this problem now, by setting colors
more selectively, as in the lines commented out below.

p.recursive{|w|
			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
                         w.children.each{|x| 
                           x.backColor=WHITE_BACK_COLOR
                           x.baseColor=WHITE_BACK_COLOR
                          }
                        else                          
                        #elsif /Label/.match(w.type.to_s)
                        w.backColor=STD_BACK_COLOR  # this causes a problem
                        #elsif /Button/.match(w.type.to_s)
                       # w.backColor=STD_BACK_COLOR
                        
                        end
          	}

So even though I don't understand why this program behaves like this,
it works ,  thank you!

Best regards,

Axel 


-------- Original-Nachricht --------
Datum: Sat, 8 Jul 2006 21:34:54 -0500
Von: Lyle Johnson <lyle at knology.net>
An: Axel Etzold <AEtzold at gmx.de>
Betreff: Re: [fxruby-users] FXCombobox -set background color

> 
> On Jul 8, 2006, at 5:16 PM, Axel Etzold wrote:
> 
> > thank you also for your reply to my background color
> > question. I have tried various color constants , but
> > I don't think that the problem is correctly identified
> > yet. What I don't understand is, why is the color
> > of the pane set to white, say, if that's the prescribed
> > color of the FXTextField child of FXCombobox, but the
> > one option that's visible, if you don't click on the
> > item is still in the other color.
> 
> Because I still don't understand the question, I've written a short  
> and to the point little program that displays a combo box (attached).  
> Make minor modifications to it, if you need to, to reproduce the  
> problem you're describing. Once you've done that, please tell me (1)  
> what it is that you were expecting to see, and (2) what it is that  
> you're actually (unexpectedly) seeing.
> 

-- 


Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer
-------------- next part --------------
A non-text attachment was scrubbed...
Name: combobox.zip
Type: application/x-zip-compressed
Size: 21028 bytes
Desc: not available
Url : http://rubyforge.org/pipermail/fxruby-users/attachments/20060709/eb53030b/attachment-0001.bin 


More information about the fxruby-users mailing list