added temp title

This commit is contained in:
Nicholas Dyer 2023-12-21 12:43:38 -05:00
parent cbc9d80188
commit ac8653783d
Signed by: ndyer
GPG Key ID: E5426C53DE17E1B2

View File

@ -2,6 +2,9 @@ import keyboard
import time
import os
HIGHLIGHTED = '\033[38;5;0m\033[48;5;2m'
REGULAR = '\033[38;5;2m'
def put_cursor(line, col):
return f'\033[{int(line)};{int(col)}f'
@ -42,12 +45,15 @@ class Menu:
print(f'{self.regular}{option}')
def main():
os.system('clear')
print('\033[?25l', end='\r')
print('\033[8m', end='\r')
selected_item = 0
os.system('stty -echo')
term_size = os.get_terminal_size()
print('\033[?25l', end='')
title = '[Interactive Text Menu]'
title_col_start = int((term_size.columns / 2) - (len(title) / 2))
print(f'{put_cursor(0, title_col_start)}{REGULAR}{title}', end='\n')
menu = Menu(10)
menu.draw()
while True: