Skip to content

update to latest text zone, Label! #13

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 12, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions adafruit_pyportal.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,11 @@

from adafruit_esp32spi import adafruit_esp32spi
import adafruit_esp32spi.adafruit_esp32spi_requests as requests
from adafruit_display_text.text_area import TextArea
try:
from adafruit_display_text.text_area import TextArea # pylint: disable=unused-import
print("*** WARNING ***\nPlease update your library bundle to the latest 'adafruit_display_text' version as we've deprecated 'text_area' in favor of 'label'") # pylint: disable=line-too-long
except ImportError:
from adafruit_display_text.Label import Label
from adafruit_bitmap_font import bitmap_font

import storage
Expand Down Expand Up @@ -425,7 +429,7 @@ def set_caption(self, caption_text, caption_position, caption_color):
board.DISPLAY.wait_for_frame()
return

self._caption = TextArea(self._caption_font, text=str(caption_text))
self._caption = Label(self._caption_font, text=str(caption_text))
self._caption.x = caption_position[0]
self._caption.y = caption_position[1]
self._caption.color = caption_color
Expand All @@ -452,7 +456,7 @@ def set_text(self, val, index=0):
if item == self._text[index]:
break
items.append(item)
self._text[index] = TextArea(self._text_font, text=string)
self._text[index] = Label(self._text_font, text=string)
self._text[index].color = self._text_color[index]
self._text[index].x = self._text_position[index][0]
self._text[index].y = self._text_position[index][1]
Expand All @@ -463,7 +467,7 @@ def set_text(self, val, index=0):

if self._text_position[index]: # if we want it placed somewhere...
print("Making text area with string:", string)
self._text[index] = TextArea(self._text_font, text=string)
self._text[index] = Label(self._text_font, text=string)
self._text[index].color = self._text_color[index]
self._text[index].x = self._text_position[index][0]
self._text[index].y = self._text_position[index][1]
Expand Down