Skip to content

Commit 1be4aa3

Browse files
author
Margaret Matocha
committed
Updated _padding example to meet pylint requirements
1 parent 2efbd77 commit 1be4aa3

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

examples/display_text_background_color_padding.py

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,11 @@
44
import board
55
import displayio
66
import time
7-
import terminalio
8-
import fontio
9-
import sys
10-
import busio
117

128
# from adafruit_st7789 import ST7789
139
from adafruit_ili9341 import ILI9341
1410
from adafruit_display_text import label
11+
from adafruit_bitmap_font import bitmap_font
1512

1613
# Setup the SPI display
1714

@@ -27,7 +24,6 @@
2724

2825
while not spi.try_lock():
2926
spi.configure(baudrate=32000000)
30-
pass
3127
spi.unlock()
3228

3329
display_bus = displayio.FourWire(
@@ -56,9 +52,7 @@
5652

5753
display.show(None)
5854

59-
# font=terminalio.FONT
60-
61-
from adafruit_bitmap_font import bitmap_font
55+
# font=terminalio.FONT # this is the Builtin fixed dimension font
6256

6357
font = bitmap_font.load_font("fonts/BitstreamVeraSans-Roman-24.bdf")
6458

@@ -105,9 +99,9 @@
10599

106100
while True:
107101
time.sleep(2)
108-
text_area[
109-
0
110-
].text = "text" # change some text in an existing text box (must fit within existing # of characters)
102+
text_area[0].text = "text" # change some text in an existing text box
103+
# Note: changed text must fit within existing number of characters
104+
# when the Label was created
111105

112106
for area in text_area:
113107
area.background_color = 0xFF0000

0 commit comments

Comments
 (0)