[Mono-list] ModifyBG not working
    Daniel Bernhardt 
    daniel at dbernhardt.com
       
    Tue Mar 21 08:22:54 EST 2006
    
    
  
Hi all,
I just started programming in c# and mono and have difficulties to set the 
background color of a label. Even if I include the label in an EventBox and 
changing the Background Color of the EventBox didn't work. I then tried to 
change the Color (foreground and background) of any Widget (Button, Window, 
Layout) without success. 
Here are code examples i used:
EventBox box = new EventBox();
label1 = new Label("Value")
Gdk.Color col = new Gdk.Color();
Gdk.Color.Parse("red", ref col);
box.ModifyBg(Gtk.StateType.Normal, col);
box.Add(label1);
or
<any widget>.ModifyFg(StateType.Normal, new Gdk.Color(0x00, 0xff,0x00));
I am adding all Labels and Buttons to a Layout inside a ScrollableWindow. 
Could that be the problem?
Any advice?
Versions i use:
Mono JIT compiler version 1.1.13.4
glade-sharp: 2.8.0
gtk-sharp: 2.8.0
Thanks in advance,
Daniel
    
    
More information about the Mono-list
mailing list