Skip to content

Commit dcf7d89

Browse files
authored
Merge pull request #13 from makermelissa/master
Changed button to subclass of Group
2 parents 99f81b1 + a38e7cc commit dcf7d89

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

adafruit_button.py

+2-5
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def _check_color(color):
5656
return color
5757

5858

59-
class Button():
59+
class Button(displayio.Group):
6060
# pylint: disable=too-many-instance-attributes, too-many-locals
6161
"""Helper class for creating UI buttons for ``displayio``.
6262
@@ -87,6 +87,7 @@ def __init__(self, *, x, y, width, height, name=None, style=RECT,
8787
label=None, label_font=None, label_color=0x0,
8888
selected_fill=None, selected_outline=None,
8989
selected_label=None):
90+
super().__init__()
9091
self.x = x
9192
self.y = y
9293
self.width = width
@@ -135,10 +136,6 @@ def __init__(self, *, x, y, width, height, name=None, style=RECT,
135136

136137
self.label = label
137138

138-
# else: # ok just a bounding box
139-
# self.bodyshape = displayio.Shape(width, height)
140-
# self.group.append(self.bodyshape)
141-
142139
@property
143140
def label(self):
144141
"""The text label of the button"""

0 commit comments

Comments
 (0)