Skip to content

Commit e4a9a6a

Browse files
committed
Changes to Label and label.
1 parent a9ac552 commit e4a9a6a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

adafruit_button.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040

4141
from micropython import const
4242
import displayio
43-
from adafruit_display_text.text_area import TextArea
43+
from adafruit_display_text.label import Label
4444
from adafruit_display_shapes.rect import Rect
4545
from adafruit_display_shapes.roundrect import RoundRect
4646

@@ -69,9 +69,9 @@ class Button():
6969
Defaults to RECT.
7070
:param fill_color: The color to fill the button. Defaults to 0xFFFFFF.
7171
:param outline_color: The color of the outline of the button.
72-
:param label: The button label. Defaults to 0x0.
72+
:param label: The text that appears inside the button. Defaults to not displaying the label.
7373
:param label_font: The button label font.
74-
:param label_color: The color of the button label. Defaults to 0x0.
74+
:param label_color: The color of the button label text. Defaults to 0x0.
7575
:param selected_fill: Inverts the fill color.
7676
:param selected_outline: Inverts the outline color.
7777
:param selected_label: Inverts the label color.
@@ -138,7 +138,7 @@ def __init__(self, *, x, y, width, height, name=None, style=RECT,
138138
dims = label_font.text_bounding_box(label)
139139
if dims[2] >= width or dims[3] >= height:
140140
raise RuntimeError("Button not large enough for label")
141-
self.label = TextArea(label_font, text=label)
141+
self.label = Label(label_font, text=label)
142142
self.label.x = x + (width - dims[2]) // 2
143143
self.label.y = y + (height - dims[3])
144144
self.label.color = label_color

0 commit comments

Comments
 (0)