Changed the project to python TUI

This commit is contained in:
Ricardo
2022-05-28 09:46:14 +00:00
parent bb401cf087
commit 8ea3ad9525
6 changed files with 36 additions and 70 deletions

36
main.py Normal file
View File

@@ -0,0 +1,36 @@
#!/usr/bin/env python3
import sys
import pytermgui as ptg
# Define empty config as the base
#
# Note that we define markup tags as empty.
# markup tags **need** to be defined for program
# execution.
PTG_CONFIG = """\
config: {}
markup:
title: 210 bold
body: 245 italic
"""
with ptg.WindowManager() as manager:
# Initialize a loader, and load our config
loader = ptg.YamlLoader()
loader.load(PTG_CONFIG)
# Create a test window
manager.add(
ptg.Window()
+ "[title]This is our title"
+ ""
+ {"[body]First key": ['First button']}
+ {"[body]Second key": ['Second button']}
+ {"[body]Third key": ['Third button']}
+ ""
+ ["Exit", lambda *_: manager.exit()]
)
manager.run()