From 811c3d52ae97a11785876e2e879f64a9f4de4738 Mon Sep 17 00:00:00 2001 From: Simon Cross Date: Wed, 2 Mar 2016 23:52:47 +0200 Subject: [PATCH] Add image button. --- koperkapel/actors/buttons.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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): -- 2.34.1