]> git.llucax.com Git - z.facultad/75.42/plaqui.git/blob - tests/GUI/item.cc
25ca9f3ad0200077fec83f29d25e4661b65d68d9
[z.facultad/75.42/plaqui.git] / tests / GUI / item.cc
1
2
3 #include "item.h"
4 #include <iostream>
5
6 CItem::CItem(const char *filename):Gtk::DrawingArea()
7 {
8         std::cout << "CItem::CItem() -> Usando " << filename << std::endl;
9         image = Gdk::Pixbuf::create_from_file(filename);
10
11         std::cout << "CItem::CItem() -> w = " << image->get_width() << " h = " << image->get_height() << std::endl;
12         set_size_request(image->get_width(), image->get_height());
13 }
14
15 CItem::~CItem()
16 {
17 }
18
19 bool CItem::on_expose_event(GdkEventExpose* event)
20 {
21         image->render_to_drawable(get_window(), get_style()->get_black_gc(), \
22                                         0, 0, 0, 0, image->get_width(), image->get_height(), Gdk::RGB_DITHER_NONE, 0, 0);
23
24         Gtk::DrawingArea::on_expose_event(event);
25         return true;
26 }
27
28