]> git.llucax.com Git - z.facultad/75.42/plaqui.git/blobdiff - Constructor/codo.cpp
Me vuelvo loco cd Constructor/cd Constructor/ pero hubo una regresion, para rotar...
[z.facultad/75.42/plaqui.git] / Constructor / codo.cpp
index baa3aaa9cc3d1df21c951587129281075e3930e6..75c9d26b5da2885419d9b851eb227ad063ff7cf9 100644 (file)
@@ -8,7 +8,7 @@ Codo::Codo()
        imageO = Gdk::Pixbuf::create_from_file("codo_o.png");
        null = Gdk::Pixbuf::create_from_file("null.png");
        imgActual = 0;
-       image = imageN;
+       image = imageO;
        set_size_request(image->get_width(), image->get_height());
 }
 
@@ -18,8 +18,8 @@ Codo::~Codo()
 
 bool Codo::on_button_press_event(GdkEventButton *event)
 {
-       if (event->type == GDK_2BUTTON_PRESS){
-               image = null;  //como hago para actualizar?????
+       if ((event->type == GDK_BUTTON_PRESS) && ( event->button == 2)){
+               image = null;   
                image->render_to_drawable(get_window(),get_style()->get_black_gc(),0,0,0,0,image->get_width(),image->get_height(),Gdk::RGB_DITHER_NONE,0,0);
                imgActual++;
                switch (imgActual) {
@@ -36,7 +36,12 @@ bool Codo::on_button_press_event(GdkEventButton *event)
                                imgActual = 0;
                                image = imageN;                 
                }
+               set_size_request(image->get_width(),image->get_height());
                image->render_to_drawable(get_window(),get_style()->get_black_gc(),0,0,0,0,image->get_width(),image->get_height(),Gdk::RGB_DITHER_NONE,0,0);
        }
+       if ((event->type == GDK_BUTTON_PRESS) && ( event->button == 3)){
+               menu_popup.popup(event->button, event->time);
+                return true; //It has been handled.
+       }
        return true;
 }