Skip to content

refactor(mcp23009e): Migrate menu_navigation example to steami_screen. #374

@nedseb

Description

@nedseb

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions