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.2.tar.gz.

File metadata

File hashes

Hashes for circuitpython-displayio-listselect-1.0.2.tar.gz
Algorithm Hash digest
SHA256 4db13f7bbda59346812fb3f308ab65418eedf93fb0580e07ac01c21aedc0cba1
MD5 315cb2318a8b91239e955841aa093579
BLAKE2b-256 5225a6ffb3f7bbce54417cfabdc45f1b812b25e617bc769178c0e4ee34868ff0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for circuitpython_displayio_listselect-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 5370b297654d0c2bd23e96d116139943fe9cf21830a61e64404c47690cc4fd8e
MD5 450b2e069220be46c8d1f3d4172fe5b0
BLAKE2b-256 fefd2a90c4eb4eb864fd1c3a40aad3c2754035d7c5dad38789271c3b5f7c5e7f

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