Description
Migrate lib/mcp23009e/examples/menu_navigation.py from direct SSD1327 calls to the steami_screen widget API.
Current state
The example manually renders a menu on the OLED using oled.text() with hand-coded positioning and highlight logic. This is exactly what screen.menu() does.
Proposed change
Replace:
import ssd1327
display = ssd1327.WS_OLED_128X128_SPI(spi, dc, res, cs)
# manual text positioning, highlight rectangles, etc.
With:
from steami_screen import Screen, SSD1327Display
display = SSD1327Display(ssd1327.WS_OLED_128X128_SPI(spi, dc, res, cs))
screen = Screen(display)
screen.menu(items, selected=idx)
screen.show()
Reference
Description
Migrate
lib/mcp23009e/examples/menu_navigation.pyfrom direct SSD1327 calls to the steami_screen widget API.Current state
The example manually renders a menu on the OLED using
oled.text()with hand-coded positioning and highlight logic. This is exactly whatscreen.menu()does.Proposed change
Replace:
With:
Reference
lib/mcp23009e/examples/menu_navigation.pyscreen.menu(items, selected=0)calibrate_magnetometer.py(PR refactor(steami_config): Migrate calibrate_magnetometer to steami_screen UI. #357)