From: Simon Cross Date: Sat, 10 Sep 2016 14:18:16 +0000 (+0200) Subject: Allow supplying and image to image button. X-Git-Tag: tabakrolletjie-v1.0.0~99 X-Git-Url: https://git.ctpug.org.za/?a=commitdiff_plain;h=6909e6357a45ec97885d91424f38a377364f89fe;p=tabakrolletjie.git Allow supplying and image to image button. --- diff --git a/tabakrolletjie/widgets.py b/tabakrolletjie/widgets.py index 8ca16e3..72d726f 100644 --- a/tabakrolletjie/widgets.py +++ b/tabakrolletjie/widgets.py @@ -66,7 +66,9 @@ class ImageButton(Button): def __init__(self, *imgparts, **kwargs): transform = kwargs.pop("transform", NullTransform()) - self._img = loader.load_image(*imgparts, transform=transform) + self._img = kwargs.pop("image", None) + if self._img is None: + self._img = loader.load_image(*imgparts, transform=transform) name = kwargs.get('name') pos = kwargs.get('pos') padding = kwargs.get('padding', 0)