Mercurial > pyntnclick
changeset 601:0ae62d824d2f pyntnclick
Can haz imagebutton
author | Stefano Rivera <stefano@rivera.za.net> |
---|---|
date | Sat, 11 Feb 2012 20:00:59 +0200 |
parents | fabce47e542f |
children | 1aac5a3b17e1 |
files | pyntnclick/widgets/imagebutton.py |
diffstat | 1 files changed, 12 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/pyntnclick/widgets/imagebutton.py Sat Feb 11 20:00:59 2012 +0200 @@ -0,0 +1,12 @@ +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)