From 6909e6357a45ec97885d91424f38a377364f89fe Mon Sep 17 00:00:00 2001 From: Simon Cross Date: Sat, 10 Sep 2016 16:18:16 +0200 Subject: [PATCH] Allow supplying and image to image button. --- tabakrolletjie/widgets.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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) -- 2.34.1