Changed the project to python TUI
This commit is contained in:
36
main.py
Normal file
36
main.py
Normal 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()
|
Reference in New Issue
Block a user