From: Simon Cross Date: Wed, 2 Mar 2016 21:52:47 +0000 (+0200) Subject: Add image button. X-Git-Url: https://git.ctpug.org.za/?a=commitdiff_plain;h=811c3d52ae97a11785876e2e879f64a9f4de4738;p=koperkapel.git Add image button. --- diff --git a/koperkapel/actors/buttons.py b/koperkapel/actors/buttons.py index d6e3954..ac14f64 100644 --- a/koperkapel/actors/buttons.py +++ b/koperkapel/actors/buttons.py @@ -1,13 +1,20 @@ """ Buttons. """ +from pgzero.actor import Actor from pgzero.ptext import getsurf from .surf import SurfActor +class ImageButton(Actor): + def __init__(self, *args, action=None, **kwargs): + super().__init__(*args, **kwargs) + self.action = action + + class TextButton(SurfActor): def __init__(self, text, action=None, **kwargs): self.text(text, **kwargs) - super(TextButton, self).__init__(self._surf) + super().__init__(self._surf) self.action = action def select(self):