Skip to main content

ListSelect widget for circuitpython displayio. Display a list of strings with a selection indicator allow user to move selection up and down.

Project description

Introduction

Documentation Status Discord Build Status Code Style: Black

ListSelect widget for circuitpython displayio. Display a list of strings with a selection indicator allow user to move selection up and down.

Dependencies

This driver depends on:

Please ensure all dependencies are available on the CircuitPython filesystem. This is easily achieved by downloading the Adafruit library and driver bundle or individual libraries can be installed using circup.

Installing from PyPI

On supported GNU/Linux systems like the Raspberry Pi, you can install the driver locally from PyPI. To install for current user:

pip3 install circuitpython-displayio-listselect

To install system-wide (this may be required in some cases):

sudo pip3 install circuitpython-displayio-listselect

To install in a virtual environment in your current project:

mkdir project-name && cd project-name
python3 -m venv .venv
source .env/bin/activate
pip3 install circuitpython-displayio-listselect

Installing to a Connected CircuitPython Device with Circup

Make sure that you have circup installed in your Python environment. Install it with the following command if necessary:

pip3 install circup

With circup installed and your CircuitPython device connected use the following command to install:

circup install displayio_listselect

Or the following command to update an existing version:

circup update

Usage Example

import time
import displayio
import board
from displayio_listselect import ListSelect

display = board.DISPLAY

main_group = displayio.Group()
display.show(main_group)

items = ["First", "Second", "Third", "Fourth"]

list_select = ListSelect(scale=2, items=items)

main_group.append(list_select)

list_select.anchor_point = (0.5, 0.5)
list_select.anchored_position = (display.width // 2, display.height // 2)

for i in range(3):
    list_select.move_selection_down()
    time.sleep(1)

for i in range(3):
    list_select.move_selection_up()
    time.sleep(1)

list_select.selected_index = 3
while True:
    pass

Documentation

API documentation for this library can be found on Read the Docs.

For information on building library documentation, please check out this guide.

Contributing

Contributions are welcome! Please read our Code of Conduct before contributing to help this project stay welcoming.

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

Built Distribution

File details

Details for the file circuitpython-displayio-listselect-1.0.1.tar.gz.

File metadata

File hashes

Hashes for circuitpython-displayio-listselect-1.0.1.tar.gz
Algorithm Hash digest
SHA256 b03ceed8b2cda4d560e16fb7b66248b24c76cc4ab6d62a660bd507facda68a52
MD5 e24f977d3835fb11f89904a1c52e4d82
BLAKE2b-256 6f0ffeaeb286fc287f9ad6b7e7a2b32385250a38264b52bb06fe74540b9dc21b

See more details on using hashes here.

File details

Details for the file circuitpython_displayio_listselect-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for circuitpython_displayio_listselect-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d2a11f5476a33791b6852ad807516f53fa2701ca3672d9ae32a170521e7ff517
MD5 79c428e6390c84477788a9f9bfda01cc
BLAKE2b-256 f001f0d2a382246ef77d628e1438456e43c199814186f39f456ba7ae5f76d9cd

See more details on using hashes here.

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