bool ViewUnion::on_image_expose_event(GdkEventExpose *e)
{
- Glib::RefPtr<Gdk::Colormap> colormap = image.get_colormap();
- colormap->alloc_color(color);
+ Glib::RefPtr<Gdk::Colormap> colormap = Gtk::Widget::get_default_colormap();
+ if (!colormap->alloc_color(color, false, false)) {
+ std::cout << "ERROR ALOCANDO COLOR!" << std::endl;
+ }
gc->set_foreground(color);
gc->set_background(color);
+
+ if (name == "union6") {
+ std::cout << color.get_red() << " " << color.get_green() << " " << color.get_blue() << std::endl;
+ }
int w,h;
w = image.get_width();
h = image.get_height();