Re: can't change color of label



I found out the problem,

The values for set_rgb are 16 bit, and not 8 bit, so calling set_rgb(0,220,0); is very close to black, instead of to green...

Oded.



----- Original Message ----- From: "oded" <o sadglad com>
To: <gtkmm-list gnome org>
Sent: Tuesday, August 29, 2006 11:51 AM
Subject: Re: can't change color of label



Ok, made a mistake in my post:

If I initilize the color like this:
Gdk::Color* color = new Gdk::Color("green");
Then it does it work, contrary to what I said.

But If I use this:
Gdk::Color* color = new Gdk::Color();
color->set_rgb(0,220,0);

then the label will stay black.
And adding these lines to allocate the color does not help.
Glib::RefPtr<Gdk::Colormap> colorMap=Gdk::Colormap::get_system();
colorMap->alloc_color(*color, true, true);

Thanks,

Oded.





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