52 lines
1.0 KiB
Python
52 lines
1.0 KiB
Python
#!/usr/bin/env python3
|
|
|
|
import curses
|
|
from curses import wrapper
|
|
|
|
|
|
|
|
class MyApp(object):
|
|
def __init__(self, screen):
|
|
curses.curs_set(0)
|
|
curses.init_color(0,0,0,0)
|
|
screen.box()
|
|
|
|
Cols22 = (curses.COLS - 2) * 0.22
|
|
Cols22 = int(Cols22)
|
|
|
|
Cols56 = (curses.COLS - 2) * 0.56
|
|
Cols56 = int(Cols56) + 1
|
|
|
|
Lines = (curses.LINES -2) * 0.95
|
|
Lines = int(Lines)
|
|
|
|
title = "Sparks-Skraps" + " COLS -> " + str(curses.COLS) + " LINES -> " + str(Cols56)
|
|
titlePos = (curses.COLS / 2) - (len(title) / 2)
|
|
|
|
screen.addstr(1, int(titlePos), title)
|
|
screen.refresh()
|
|
|
|
|
|
components = curses.newwin(Lines,Cols22,3,1)
|
|
components.box()
|
|
components.addstr(1, 1, "precious components")
|
|
components.refresh()
|
|
|
|
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)
|