4 CItem::CItem(const char *filename):Gtk::DrawingArea()
6 image = Gdk::Pixbuf::create_from_file(filename);
7 set_size_request(image->get_width(), image->get_height());
12 menu_image.set(Gtk::Stock::CANCEL, Gtk::ICON_SIZE_MENU);
13 Gtk::Menu::MenuList& menulist = menu_popup.items();
14 menulist.push_back( Gtk::Menu_Helpers::MenuElem("Opcion", SigC::slot(*this, &CItem::on_menu_file_popup_generic) ) );
15 menulist.push_back( Gtk::Menu_Helpers::MenuElem("Rotar", Gtk::Menu::AccelKey("<control>r"),SigC::slot(*this, &CItem::on_menu_file_popup_generic) ) );
16 menulist.push_back( Gtk::Menu_Helpers::ImageMenuElem("Eliminar", menu_image,SigC::slot(*this, &CItem::on_menu_file_popup_generic) ) ) ;
17 menu_popup.accelerate(*this);
24 bool CItem::on_expose_event(GdkEventExpose* event)
26 image->render_to_drawable ( get_window(), get_style()->get_black_gc(), 0, 0, 0, 0, image->get_width() ,image->get_height() ,
27 Gdk::RGB_DITHER_NONE, 0, 0);
29 // XXX Esto no deberia ser necesario! en todo caso devolves false en
30 // vez de true para que siga llamando a los otros handlers :)
31 //Gtk::DrawingArea::on_expose_event(event);
35 void CItem::on_menu_file_popup_generic()
37 std::cout << "A popup menu item was selected." << std::endl;