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);
+
int w,h;
w = image.get_width();
h = image.get_height();