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

# Make the display context. Change size if you want
display = board.DISPLAY

# Make the display context
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.0.tar.gz.

File metadata

File hashes

Hashes for circuitpython-displayio-listselect-1.0.0.tar.gz
Algorithm Hash digest
SHA256 ee5d8bd78cbc39ded32166b5521a3ae4b4fd9e61297b340de703959e5c538512
MD5 597cb5a09750473fcb62b7b6dffba78a
BLAKE2b-256 cac32f9eee9b085313880fe07e8c4aa0172659372a5196995014c5eb22ce2ddd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for circuitpython_displayio_listselect-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b7947d06734ee17b9ac405853f5f5c89c232b5e88f45383fbb3d18e1e22ec51c
MD5 0abeb2d36958b1c8e4b493476d998c62
BLAKE2b-256 3e5efe03ab2a40614c27c7aacdedc7b8f443ddc8d2038c40218a4541ab87777f

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