Skip to main content

Package with widgets and components for Textual TUI Framework.

Project description

CvaniaK's Widgets for Textual TUI (ck_widgets)

This is list of Widgets for Textual framework, created from my personal need.

NOTE: This project widgets names, arguments, etc. can vary along diffrent versions.

Install

ValueBar

CoolBarGif

Examples

The simples example:

# Simples value bar
from ck_widgets.widgets import ValueBarH, ValueBarV
vbar_horizontal = ValueBarH(max_value=50)
# or 
vbar_vertical = ValueBarV(max_value=50)

And here is example with almost all arguments:

Example with many arguments

# Example with almost all arguments
from ck_widgets.widgets import ValueBarH, CColor, CustomColor
from rich import box

background_color: List[CColor] = ["rgb(0,0,0)", "rgb(0,0,0)", "yellow"]
ValueBarH(
    name="name_to_catch_in_event",
    label="Almost all arguments",
    label_align="left",
    label_position="bottom",
    start_value=25,
    max_value=50,
    height=6,
    instant=True,
    reversed=True,
    color=CustomColor.gradient("green", "rgb(0, 100, 250)"),
    bg_color=background_color,
    border_style="yellow",
    padding=(1,1),
    box=box.DOUBLE_EDGE,
)

And this example:
LotOfValueBars

you can check code in this file ck_widgets/exmples/value_bar.py or test it by using command below:

python3 -m ck_widgets.examples.value_bar
Known Limitations
  • You need to force size of layout to be not smaller than maximum size of of ValueBar (otherwise it will behave badly)
  • ...
TODO
  • Reactive version (so it gives values from 0 to 1 and can be resized/'squashed')
  • Be sure that provide all arguments
  • Test edge cases
  • Clean up how to provide color
  • Label on left or right site
  • ...

Change Log

[0.1.0] - 2022-02-26

Added

  • ValueBar
  • Test version of DebugWidget

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

ck_widgets-0.1.0-py3-none-any.whl (9.7 kB view hashes)

Uploaded Python 3

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