Logo Search packages:      
Sourcecode: panflute version File versions  Download package

def panflute::applet::widget::Button::do_expose_event (   self,
  event 
)

Draw the button image, appropriately adjusted for the button state.

Definition at line 211 of file widget.py.

00211                                      :
        """
        Draw the button image, appropriately adjusted for the button state.
        """

        if self.__inside:
            pixbuf = self.__mouseover_pixbuf
        else:
            pixbuf = self.__normal_pixbuf

        if pixbuf is None:
            return True

        # Center the pixbuf in the button's allocated area

        width = pixbuf.get_width ()
        height = pixbuf.get_height ()
        x = self.allocation.x + (self.allocation.width - width) // 2
        y = self.allocation.y + (self.allocation.height - height) // 2

        if self.__pressed and self.__inside:
            x += self.DISPLACEMENT
            y += self.DISPLACEMENT

        # Clip to the visible area and the area that needs to be redrawn

        target_area = gtk.gdk.Rectangle (x, y, width, height)
        draw_area = event.area.intersect (self.allocation)
        draw_area = draw_area.intersect (target_area)

        if draw_area.width > 0 and draw_area.height > 0:
            self.window.draw_pixbuf (None, pixbuf,
                                     draw_area.x - target_area.x, draw_area.y - target_area.y,
                                     draw_area.x, draw_area.y,
                                     draw_area.width, draw_area.height,
                                     gtk.gdk.RGB_DITHER_NORMAL,
                                     0, 0)

        return False


    def __reload_image (self):


Generated by  Doxygen 1.6.0   Back to index