Tkinter-like themed UI framework for curses... New aditions to 0.3.1: proportional x,y,width,height
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", "settings.json") # leave either of these blank to get a defaul writen to a defaultTheme.json or defaultSettings.jdon
app.addWidget(app.Label("Hello World!", 0,0))
app.main_loop()
curses.wrapper(main)
Widgets
global functions
widget.delete() # delete a widget you have created and un-render it and remove it from the apps widgets allong with all its children
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":">"}
}
}
Theme options
| key | options | explination |
|---|---|---|
| ["input"]["style"] | "box"/"default" | box shows inpu as a box and defalut shows it like python input |
| ["text"]["theme"] | Anything you please | Not a thing yet... to be filled in |
Settings and keybinds
A recent adition to this library is the ability to add settings.json to your program (or rather the requirmen too) here is an example of what you have to have so far (not all of them work yet but will in future updates)
{
"keybindings": {
"Move-Focus-Forward": "TAB",
"Move-Focus-Back": "None",
"Move-Focus-In-Frame-Forward": "CTRL+D",
"Move-Focus-In-Frame-Backward": "None",
"Exit-Text-box": "CTRL+M",
"Quit-Program": "ESC"
}
}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tkurses-0.3.11.tar.gz.
File metadata
- Download URL: tkurses-0.3.11.tar.gz
- Upload date:
- Size: 8.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.8.20
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8eeed75883b782736c196000e1540ebb0064efb12d80cd4b47830ddea9296957
|
|
| MD5 |
955650a4a3ad2d74bd421e0645091c93
|
|
| BLAKE2b-256 |
e81f315dcecf38abeffd2c9e531dc94aece8790e73508a506ee4248e60944849
|
File details
Details for the file tkurses-0.3.11-py3-none-any.whl.
File metadata
- Download URL: tkurses-0.3.11-py3-none-any.whl
- Upload date:
- Size: 10.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.8.20
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ae7da80ace8e36dbfd5dccbe926a38843af6abf0554e80e314ab43850649e150
|
|
| MD5 |
e2e39399b32d668921eb043a4f58af63
|
|
| BLAKE2b-256 |
3ad8209c62c590ca55d2ea2c4485ce748670afedc8992abc4dc33bf9653b0e66
|