Screen¶
- class Screen(items)[source]¶
Bases:
objectInitialize the screen window Attributes
window: A full curses screen window width: The width of window height: The height of window max_lines: Maximum visible line count for result_window top: Available top line position for current page (used on scrolling) bottom: Available bottom line position for whole pages (as length of items) current: Current highlighted line number (as window cursor) page: Total page count which being changed corresponding to result of a query (starts from 0) ┌————————————–┐ |1. Item | |--------------------------------------| <- top = 1 |2. Item | |3. Item | |4./Item///////////////////////////////| <- current = 3 |5. Item | |6. Item | |7. Item | |8. Item | <- max_lines = 7 |--------------------------------------| |9. Item | |10. Item | <- bottom = 10 | | | | <- page = 1 (0 and 1) └————————————–┘
- Returns
None
Methods
batchDisplay the items on window
Setup the curses
Waiting an input and run a proper method according to type of input
Paging the window when pressing left/right arrow keys
Continue running the TUI until get interrupted
Scrolling the window when pressing up/down arrow keys
Attributes
DOWNUP- __init__(items)[source]¶
Initialize the screen window Attributes
window: A full curses screen window width: The width of window height: The height of window max_lines: Maximum visible line count for result_window top: Available top line position for current page (used on scrolling) bottom: Available bottom line position for whole pages (as length of items) current: Current highlighted line number (as window cursor) page: Total page count which being changed corresponding to result of a query (starts from 0) ┌————————————–┐ |1. Item | |--------------------------------------| <- top = 1 |2. Item | |3. Item | |4./Item///////////////////////////////| <- current = 3 |5. Item | |6. Item | |7. Item | |8. Item | <- max_lines = 7 |--------------------------------------| |9. Item | |10. Item | <- bottom = 10 | | | | <- page = 1 (0 and 1) └————————————–┘
- Returns
None