Skip to main content

Tkinter-like themed UI framework for curses... New aditions to 0.2.6: setings and custom keybindings

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: tkurses-0.2.7.tar.gz
  • Upload date:
  • Size: 7.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.7.tar.gz
Algorithm Hash digest
SHA256 e8b2a4195e95ef221829844ba0b70fddb29887fa2aea1e33ce9f34030c7a2d0d
MD5 dd4ab44ab26cf6b714ea0dff4ceb95d6
BLAKE2b-256 094b0f2a76865134184d976bdaa6d3b5c57185f0be55df50d723f28ede301b57

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tkurses-0.2.7-py3-none-any.whl
  • Upload date:
  • Size: 9.6 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.7-py3-none-any.whl
Algorithm Hash digest
SHA256 6636a905397e4ead77c0158333b0068b0fd98b5cf8e3e78fbc6220fb1b2f0f03
MD5 3e35e860f9602e37245770170d1377e5
BLAKE2b-256 481ae6e6f29b5ece21e8caeb9bf19d061fe6bf19f7b4d92768a287b1b547d569

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