A Textual widget for a simple slider
Project description
textual-slider
A Textual widget for a simple slider.
Installation
Install textual-slider using pip:
pip install textual-slider
Usage
textual-slider provides a simple Slider
widget for use in
Textual, that allows selecting an
integer value within a given range.
The initial value of the slider if not specified is the minimum value. You can also optionally specify a step size between valid values.
yield Slider(0, 10)
yield Slider(min=200, max=500, step=100, value=300)
You can find more complete usage examples of the Slider
widget in the
/examples/
directory of this repo.
Limitations
Textual apps run in the terminal, which work in terms of character cells rather than pixels. This means you obviously can't have the same fine-grained control for this slider as usual, depending on the size of the slider range and the styled width.
Currently this slider widget only works with integer values. Any suggestions for how to work with floating point values would be welcome!
Contributing
I created this simple slider widget as a learning exercise to better understand Textual and it is still a work in progress.
I'd really appreciate any feedback or suggestions, but I'm afraid I probably won't be accepting any PRs at the moment.
Licence
Licensed under the GNU General Public License v3.0.
Project details
Release history Release notifications | RSS feed
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 textual-slider-0.1.2.tar.gz
.
File metadata
- Download URL: textual-slider-0.1.2.tar.gz
- Upload date:
- Size: 16.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bb63833045594f84988070ca25f4e1d2f3890b4e12dce6425af2b45af2555838 |
|
MD5 | cb0447418c8205729e88a5572b580b38 |
|
BLAKE2b-256 | 29bc871aaf1e2035d69fdd70efa38c01edd8df6650984a81df38a22d7e15949e |
File details
Details for the file textual_slider-0.1.2-py3-none-any.whl
.
File metadata
- Download URL: textual_slider-0.1.2-py3-none-any.whl
- Upload date:
- Size: 16.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 83f0ec7fdf3399d38ceef68416ea6163e41ce013ae0a2bf915e37d62410167e0 |
|
MD5 | f8e2d9aae8047a7a18477be5485ddeeb |
|
BLAKE2b-256 | 88b993f84bd21ca14be1348a6d8fff061a7c33a2067961673e6d673a26e41f21 |