ui
This module provides reusable UI components.
- class ui.Menu(items, select_func, select_knob=<europi.Knob object>, choice_buttons=None)
A class representing a menu displayable on the EuroPi screen. The user can select a menu item using the configured knob and select it with the configured button(s).
- Parameters
items – a list of the menu items
select_func – the function to call when a menu item is chosen. The function will be called with single argument, the selected item.
select_knob – the knob used to select the menu item, defaults to k1
choice_buttons – a List of Buttons that can be pressed to choose the selected item. Defaults to b1
This function should be called by your script’s main loop in order to display and refresh the menu.
- property selected
The currently selected menu item.