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.2.tar.gz (1.7 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.2-py3-none-any.whl (1.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: tkurses-0.2.2.tar.gz
  • Upload date:
  • Size: 1.7 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.2.tar.gz
Algorithm Hash digest
SHA256 2f71daadefe067f03566251a7ada4fb53f0c57364032a9d1ba8148723ecd2f44
MD5 b6d13f05aee5afb2719993321a94653c
BLAKE2b-256 30696b53efeaff89da6044d7ca54bdc8618d05389e99380386028b41f639225c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tkurses-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 1.7 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 d2bb9ea61f507b9c6971f49b11e4959bdf3fe607ec0b9b521d29926826f9b5c6
MD5 aa9cb175b448dcbf67c2b20597584a3d
BLAKE2b-256 afe039aed69fbe276c741176d0f0aafd696c1ba89db523d8eb5a7f2176b0742e

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