Skip to content

hanhha/console_ui

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Quick UI generator using Curses

This helps to quickly generate the UI using Python Curses library.

Install

Run this command:

python3 setup.py install

Usage example

Here is a simple code utilize this generator:

from curses import wrapper
from collections import OrderedDict
import console_utils as cls

ui_sheet = OrderedDict({
	'VLayout': {
		'title'  : (0, 4),
		'tips'   : (0, 6),
		'HLayout': {
			'VLayout'   : {
				'activities': (0, 0),
				'summary'   : (0, 7)
			},
			'current': (0, 0)
		}
	}
})

ui_win = {
	'tips': {'title':'Tips'},
	'title': {'text': 'Auto System'},
	'activities': {'title': 'Actitivites'},
	'summary': {'title': 'Summary'},
	'current': {'title': 'Latest data'},
}

UI = cls.SimpleWinMan (ui_sheet, ui_win)

def main (stdscr):
	UI.start ()
	UI.getch (True) # Wait for any keypress
	UI.end ()

if __name__ == '__main__':
	wrapper (main)
	exit (0)

About

Quick UI generator using Curses

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages