Skip to main content

Tkinter-like themed UI framework for curses... New aditions to 0.2.5: default theme file if theme=None

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: tkurses-0.2.6.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.6.tar.gz
Algorithm Hash digest
SHA256 3f3a42713d8cf888b21d493d2122166aa54a5742c29b1b4f09f6fc39dc49b95a
MD5 34a17572ac7373c556598a0f48bcebb4
BLAKE2b-256 977c351185089aa5949cf0f6170aca8315fc66c408e2cfe4d36100cd6f0d2bf0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tkurses-0.2.6-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.6-py3-none-any.whl
Algorithm Hash digest
SHA256 2ad152d2f9a620d698dce448d9aef3ecb2d28256a3ccf119be0ae4320f7cac98
MD5 ee5cdd175fc1c408febd11b55cced3af
BLAKE2b-256 fe8ae42db166cc1d093e9982f54ffd08d815a0d5a9007fa7ff23d196f52ee359

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