Skip to main content

Buttons in Linux terminal

Project description

TerminalButtons

Python curses made easy

Clicable Buttons in Linux terminal, Termux, etc

Captura de Tela 2021-08-15 às 08 03 05

Example:

from TerminalButtons import *
import curses

def example(std):
    Tb = TerminalButtons(std)
    Tb.CreateButton(positiony=CENTER,positionx=CENTER,fg=curses.COLOR_BLUE,text='hi')
    Tb.mainLoop()

curses.wrapper(example)

Methods:

CreateButton(self,positionx,positiony,fg,bg,commmand,text,row,col,typeText)
#positions = Top,Left,Bottom,Right
#fg,bg = curses COLOR (Foreground,Background Color)
#command = Function to run when click the button (without '()')
#row,col = padding
#typeText = curses BOLD,ITALIC,etc

ReqInput(self,x,y)
#x,y = coords where input will show up
#returns the string typed

AddKeyEvent(self,key,func)
#key = curses KEY
#func = Function to run when event fire

ConfigureBg(self,bg,fg)
#bg,fg = curses COLOR (will change the screen colors)

mainLoop(self)
#principal loop

ClearScreen(self)
#i need to document this?

GetMaxYX(self)
#returns the char size of terminal (x,y)

Exit(self)
#breaks the mainLoop and exit

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

TerminalButtons-1.0.0.tar.gz (3.2 kB view details)

Uploaded Source

Built Distribution

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

TerminalButtons-1.0.0-py3-none-any.whl (3.4 kB view details)

Uploaded Python 3

File details

Details for the file TerminalButtons-1.0.0.tar.gz.

File metadata

  • Download URL: TerminalButtons-1.0.0.tar.gz
  • Upload date:
  • Size: 3.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.6

File hashes

Hashes for TerminalButtons-1.0.0.tar.gz
Algorithm Hash digest
SHA256 e5be4330007716cccdcda246e347022e53daed69f33eb68769ad6e0313f7803d
MD5 ff1eb01a71641a3174a8b39eb910090c
BLAKE2b-256 4fef3cfd0b4ef79834620a9fb898c78aa432f061288c4a6f98cc408b4cd3dc83

See more details on using hashes here.

File details

Details for the file TerminalButtons-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: TerminalButtons-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 3.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.6

File hashes

Hashes for TerminalButtons-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2656d0fed261938e05412bffad13b810491ea50072f672b3fe45a6b9db269b74
MD5 b9550c3c3acc74a939494f8dac1001d3
BLAKE2b-256 4a1a61f23ef70659b4101708ef987942e583bfecb1b3c379e57a38a6afd92895

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