view pyntnclick/widgets/imagebutton.py @ 601:0ae62d824d2f pyntnclick

Can haz imagebutton
author Stefano Rivera <stefano@rivera.za.net>
date Sat, 11 Feb 2012 20:00:59 +0200
parents
children 08647ef4d324
line wrap: on
line source

from pyntnclick.widgets.base import Button


class ImageButtonWidget(Button):
    """An image that is also a button. Whatever next?"""

    def __init__(self, rect, image):
        super(ImageButtonWidget, self).__init__(rect)
        self.image = image

    def draw(self, surface):
        surface.blit(self.image, self.rect)