# Change color of greyed widget

**URL:** <https://www.ruby-forum.com/t/change-color-of-greyed-widget/213153>\
**Category:** Ruby-Gnome 2\
**Created:** [October 25, 2011, 10:17am UTC](https://www.ruby-forum.com/t/change-color-of-greyed-widget/213153 "2011-10-25T10:17:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dubstep](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cdc98d/32.png) [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Post date:** [October 25, 2011, 10:17am UTC](https://www.ruby-forum.com/t/change-color-of-greyed-widget/213153/1 "2011-10-25T10:17:09Z")

</div>

Dear all, thanks for your answer of my other question

now I got another question

how to change color of greyed widget?

I use style “click button to edit” form, so when my frame is not in  
editable  
mode,  
I set sensitive to false.  
but the frame became grey that makes it hard to read anything written on  
textbox inside the frame

I need to set sensitive to false, change color for easy recognation, but  
still having the text readble easily,  
i don’t know, perhaps more yellowish rather than greyish?

Thanks 🙂

---

<div class="post-metadata">

**Author:** ![hendra\_kusuma](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/5f8ce5/32.png) [@hendra\_kusuma](https://www.ruby-forum.com/u/hendra_kusuma)\
**Post date:** [October 25, 2011, 12:00pm UTC](https://www.ruby-forum.com/t/change-color-of-greyed-widget/213153/2 "2011-10-25T12:00:43Z")

</div>

hendra kusuma wrote in post #1028313:

> how to change color of greyed widget?
> 
> I use style “click button to edit” form, so when my frame is not in  
> editable  
> mode,  
> I set sensitive to false.  
> but the frame became grey that makes it hard to read anything written on  
> textbox inside the frame
> 
> I need to set sensitive to false, change color for easy recognation, but  
> still having the text readble easily,  
> i don’t know, perhaps more yellowish rather than greyish?

Something like :

widget\_instance.modify\_bg(Gtk::STATE\_INSENSITIVE,  
Gdk::Color.parse(“yellow”))

Look at :  
[http://ruby-gnome2.sourceforge.jp/hiki.cgi?cmd=view&p=Gtk%3A%3AWidget&key=modify\_base#modify\_base](http://ruby-gnome2.sourceforge.jp/hiki.cgi?cmd=view&p=Gtk%3A%3AWidget&key=modify_base#modify_base)  
and  
ruby-gnome2.sourceforge.jp/hiki.cgi?cmd=view&p=Gtk%3A%3AWidget&key=modify\_base#modify\_base/modify

Simon

---

<div class="post-metadata">

**Author:** ![hendra\_kusuma](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/5f8ce5/32.png) [@hendra\_kusuma](https://www.ruby-forum.com/u/hendra_kusuma)\
**Post date:** [October 25, 2011, 12:39pm UTC](https://www.ruby-forum.com/t/change-color-of-greyed-widget/213153/3 "2011-10-25T12:39:21Z")

</div>

On Tue, Oct 25, 2011 at 6:00 PM, Simon A. \<  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)\> wrote:

> > I need to set sensitive to false, change color for easy recognation, but

[http://ruby-gnome2.sourceforge.jp/hiki.cgi?cmd=view&p=Gtk%3A%3AWidget&key=modify\_base#modify\_base](http://ruby-gnome2.sourceforge.jp/hiki.cgi?cmd=view&p=Gtk%3A%3AWidget&key=modify_base#modify_base)

> and

ruby-gnome2.sourceforge.jp/hiki.cgi?cmd=view&p=Gtk%3A%3AWidget&key=modify\_base#modify\_base/modify

> Simon

Thanks, that’s very helpful

I found modify\_base works here, and that’s only on input widget like  
entry,  
not container like frame  
so I change my code to set modify\_base of all entry and set modify\_text  
to  
black to ensure it can be read

Well, that fix my problem 🙂
