Re: colors of labels in event boxes



> Hello.
> i am quite new in gtk/gtkmm programming and i was solving problem how
> highlight
> certain group of widgets by backround color. I found useful posts here and
> on
> other lists how to make labels with color backround (put them into event
> boxes), so the code listed below worked. Now i installed new ubuntu with
> newer
> version of gtkmm stuff (old 2.6.7-1, new 2.8.5-0ubuntu1) and the setting
> of
> background doesnt work any more. So if someone has notice that could help
> me
> thanks in advance.
> martin
>
> THE CODE:
> //i get in constructor * to event box
> //and put inside created label like:
>
> interfaceL = new Gtk::Label("none detected");
> m_EventBox1->add(*interfaceL);
>
> //then pack and show and in another place i have this code
> // that worked fine but does no more
>
> if(interface->isActive()){
>  	m_EventBox1->modify_bg(Gtk::STATE_NORMAL,Gdk::Color("yellow"));
> 	m_EventBox2->modify_bg(Gtk::STATE_NORMAL, Gdk::Color("yellow"));
> 	m_EventBox3->modify_bg(Gtk::STATE_NORMAL, Gdk::Color("yellow"));
> 	m_EventBox4->modify_bg(Gtk::STATE_NORMAL, Gdk::Color("yellow"));

If you have a small compileable test case then we could check it.


Murray Cumming
murrayc murrayc com
www.murrayc.com
www.openismus.com




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]