comparison mamba/widgets/imagebutton.py @ 115:d5aa5f805f00

Add Button class that buttons inherit from. It implements a 'clicked' callback
author Stefano Rivera <stefano@rivera.za.net>
date Sun, 11 Sep 2011 20:40:26 +0200
parents 45397addd80d
children 9afea431af36
comparison
equal deleted inserted replaced
114:b3985414d4d6 115:d5aa5f805f00
1 import pygame 1 import pygame
2 2
3 from mamba.widgets.base import Button
3 from mamba.widgets.text import TextWidget 4 from mamba.widgets.text import TextWidget
4 5
5 6
6 class ImageButtonWidget(TextWidget): 7 class ImageButtonWidget(Button, TextWidget):
7 """Text label with image on the left""" 8 """Text label with image on the left"""
8 9
9 def __init__(self, rect, image, text, fontsize=16, color='black'): 10 def __init__(self, rect, image, text, fontsize=16, color='black'):
10 self.image = image 11 self.image = image
11 self.focus_color = pygame.Color('yellow') 12 self.focus_color = pygame.Color('yellow')