Files
Sparks-Skraps/main.py

52 lines
1.0 KiB
Python
Raw Normal View History

2022-05-28 09:46:14 +00:00
#!/usr/bin/env python3
import curses
from curses import wrapper
2022-05-28 18:32:29 +00:00
class MyApp(object):
def __init__(self, screen):
curses.curs_set(0)
curses.init_color(0,0,0,0)
screen.box()
2022-05-28 18:32:29 +00:00
Cols22 = (curses.COLS - 2) * 0.22
Cols22 = int(Cols22)
2022-05-28 18:32:29 +00:00
Cols56 = (curses.COLS - 2) * 0.56
Cols56 = int(Cols56) + 1
2022-05-28 18:32:29 +00:00
Lines = (curses.LINES -2) * 0.95
Lines = int(Lines)
2022-05-28 18:32:29 +00:00
title = "Sparks-Skraps" + " COLS -> " + str(curses.COLS) + " LINES -> " + str(Cols56)
titlePos = (curses.COLS / 2) - (len(title) / 2)
2022-05-28 18:32:29 +00:00
screen.addstr(1, int(titlePos), title)
screen.refresh()
2022-05-28 18:32:29 +00:00
components = curses.newwin(Lines,Cols22,3,1)
components.box()
components.addstr(1, 1, "precious components")
components.refresh()
2022-05-28 18:32:29 +00:00
parts = curses.newwin(Lines, Cols22, 3, 1+Cols22)
parts.box()
parts.addstr(1, 1, "My precious parts")
parts.refresh()
info = curses.newwin(Lines, Cols56, 3, 1+Cols22*2)
info.box()
info.addstr(1, 1, "My precious info")
info.refresh()
c = screen.getch()
if __name__ == "__main__":
curses.wrapper(MyApp)