Skip to main content

Simple menu library for CircuitPython devices, designed for Adafruit RP2040 macropad.

Project description

Fruity Menu

pipeline status coverage report

Build a simple UI in CircuitPython. Designed for the Adafruit RP2040 Macropad, but usable with any displayio.Display.

The Menu

The most important class is the Menu. Instantiate one to get started, then use helper methods to add options and submenus.

Available menu options

  • ActionButton: Invoke the given function with optional arguments
  • SubmenuButton: Open another menu as a nested submenu
  • ValueButton: Adjust the value of a boolean or numeric variable
menu = Menu(display, title='Main Menu')
menu.add_action_button('Shut down', action=myobj.dafunc)

sub_settings = menu.create_menu('Settings')
sub_settings.add_value_button('Screen brightness', screen.brightness, update_screen_brightness)
menu.add_submenu_button('Open Settings...', sub_settings)

In the above example, a Menu is created and from that menu, buttons and submenus are added. To complete the implementation of this menu, you would need to provide functions myobj.dafunc and update_screen_brightness as well as the screen.brightness object used in the Value button. These fields presumably come from the code you are using the menu for, so use as you see fit.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fruity_display_menu-1.0.1.tar.gz (16.3 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page