Skip to content

Commit adca2d7

Browse files
committed
docs warning and error message for cp version
1 parent 20a64df commit adca2d7

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

adafruit_displayio_layout/layouts/tab_layout.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ class TabLayout(displayio.Group):
4242
"""
4343
A layout that organizes children into a grid table structure.
4444
45+
.. warning::
46+
Requires CircuitPython version 7.3.0-beta.2 or newer
47+
4548
:param int x: x location the layout should be placed. Pixel coordinates.
4649
:param int y: y location the layout should be placed. Pixel coordinates.
4750
:param displayio.Display display: The Display object to show the tab layout on.
@@ -167,7 +170,15 @@ def _draw_tabs(self):
167170
_new_tab_group.append(_tab_label)
168171

169172
if i == self.page_layout.showing_page_index:
170-
_tab_tilegrid.bitmap = self._active_bmp
173+
try:
174+
_tab_tilegrid.bitmap = self._active_bmp
175+
except AttributeError as e:
176+
print(e)
177+
raise (
178+
AttributeError(
179+
"TabLayout requires CircuitPython version 7.3.0-beta.2 or newer."
180+
)
181+
) from e
171182
_tab_tilegrid.pixel_shader = self._active_palette
172183
_tab_label.color = self.active_tab_text_color
173184
self.tab_dict[i] = _new_tab_group

0 commit comments

Comments
 (0)