Skip to main content

Tkinter-like themed UI framework for curses

Project description

TKurses

tkurses is a library for tkinter like interface in curses

basic program

import curses
import tkurses.core as core
import tkurses.widgets as widgits

def main(stdscr):
    app = core.App(screen, "theme.json")
    app.addWidget(app.Label("Hello World!", 0,0))

    app.main_loop()

curses.wrapper(main)

Widgets

Label

Declaring one

app.Label("what To Write",posX,posY)

Button

Declaring one

app.Button("what To Write",(posX,posY),(sizeX,sizeY),on_press=function_to_run)

Input prompt

declaring one

app.Input("prompt",(posX,posY),(sizeX,sizeY),on_press=function_to_run_on_enter_pressed)

TextBox (Experemental)

Declaring one

app.TextBox((PosX,posY),(sizeX,sizeY),enterOnEnter=true)

getting current Contents

currentTextbox.text

adding Widgets to app

app.add_widget(Variable)

Theming files

example Theme

{
    "colors": {
        "background": "black",
        "forground": "white"
    },
    "input": {
        "style": "default",
        "colors": {
            "focused": {
                "background": "black",
                "forground": "white"
            }, "not-focused": {
                "forground": "black",
                "background": "white"
            }
        }
    },
    "text": {
        "colors": {
            "background": "blue",
            "forground": "black"
        },
        "theme": "None",
        "quitKeys": ["Enter","shift-enter"]
    },
    "buttons": {
        "colors": {
            "focused": { "background": "white", "forground": "black"},
            "not-focused": {"background": "black","forground": "white"}
        },
        "start": {"focused":"[","not-focused":"<"},
        "end": {"focused": "]","not-focused":">"}
    }
}

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

tkurses-0.2.4.tar.gz (6.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tkurses-0.2.4-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

Details for the file tkurses-0.2.4.tar.gz.

File metadata

  • Download URL: tkurses-0.2.4.tar.gz
  • Upload date:
  • Size: 6.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.8.20

File hashes

Hashes for tkurses-0.2.4.tar.gz
Algorithm Hash digest
SHA256 e14adacdfe5f3e8f39ae54f2fe177bb2e8f477908ac16f382f5935705a0a56a0
MD5 586150ffd9860b892d9baa04efd227b2
BLAKE2b-256 d9586994704e193e9ed1f7138fe6e27945eb51cd7f79f61ed8beac744d63fa26

See more details on using hashes here.

File details

Details for the file tkurses-0.2.4-py3-none-any.whl.

File metadata

  • Download URL: tkurses-0.2.4-py3-none-any.whl
  • Upload date:
  • Size: 8.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.8.20

File hashes

Hashes for tkurses-0.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 ee3eb93b224078ae78f27519b5dae21bcf95b5981a14576726b0fe9185f5683d
MD5 de57d38a48d3aa31df140f09bd0222fc
BLAKE2b-256 127e9e7eb1972435823c5a95425a7377dae40497098fd3298413796f165ade50

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page