Skip to content

Commit 759c5c3

Browse files
authored
Merge pull request #88 from Neradoc/documentation-add-text-index
Document the return value of add_text()
2 parents ef951d5 + ad9d56d commit 759c5c3

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

adafruit_portalbase/__init__.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,9 +170,10 @@ def add_text(
170170
text_anchor_point=(0, 0.5),
171171
is_data=True,
172172
text=None,
173-
):
173+
) -> int:
174174
"""
175-
Add text labels with settings
175+
Add text labels with settings. Returns the index of the label,
176+
for use with ``set_text()`` and ``set_text_color()``.
176177
177178
:param str text_font: The path to your font file for your data text display.
178179
:param text_position: The position of your extracted text on the display in an (x, y) tuple.
@@ -192,6 +193,9 @@ def add_text(
192193
:param bool is_data: If True, fetch will attempt to update the label
193194
:param str text: If this is provided, it will set the initial text of the label.
194195
196+
:return: Index of the new text label.
197+
:rtype: int
198+
195199
"""
196200
if not text_wrap:
197201
text_wrap = 0

0 commit comments

Comments
 (0)