X-Git-Url: https://git.llucax.com/z.facultad/75.42/plaqui.git/blobdiff_plain/f61a5ebd00d4620af70c3780ba821f5af68def1c..9075115540d133ca048025e719884121007b9e87:/Client/src/item.cpp?ds=sidebyside diff --git a/Client/src/item.cpp b/Client/src/item.cpp index 8fab941..6bbaf1d 100644 --- a/Client/src/item.cpp +++ b/Client/src/item.cpp @@ -9,6 +9,15 @@ ViewItem::ViewItem(Glib::ustring _name):Gtk::EventBox(),image() set_events(Gdk::BUTTON_PRESS_MASK); actual_flow = -1; add(image); + + image.signal_expose_event().connect( SigC::slot(*this, &ViewItem::on_image_expose_event) ); +} + +void ViewItem::on_realize() +{ + Gtk::EventBox::on_realize(); + Glib::RefPtr window = get_window(); + gc = Gdk::GC::create(window); } ViewItem::~ViewItem() @@ -36,3 +45,12 @@ std::string ViewItem::get_actual_flow() return s; } +bool ViewItem::on_image_expose_event(GdkEventExpose *e) +{ + Glib::RefPtr colormap = image.get_colormap(); + colormap->alloc_color(color); + gc->set_foreground(color); + gc->set_background(color); + image.get_window()->draw_rectangle(gc, 1, 0, 0, 10, 10); +} +