use of com.googlecode.lanterna.screen.TerminalScreen in project narchy by automenta.
the class ConsoleGUI method start.
@Override
public void start(@Nullable SurfaceBase parent) {
synchronized (this) {
super.start(parent);
// thr.start();
try {
screen = new TerminalScreen(term);
screen.startScreen();
gui = new MultiWindowTextGUI(MyStupidGUIThread::new, screen);
// TODO try to avoid wrapping it in Window
window = new BasicWindow();
window.setPosition(new TerminalPosition(0, 0));
TerminalSize size = term.getTerminalSize();
window.setSize(new TerminalSize(size.getColumns(), size.getRows()));
window.setHints(List.of(Window.Hint.FULL_SCREEN, Window.Hint.NO_DECORATIONS));
window.setTheme(DARK);
window.setEnableDirectionBasedMovements(true);
gui.addWindow(window);
gui.setActiveWindow(window);
gui.setEOFWhenNoWindows(true);
init(window);
TextGUIThread guiThread = gui.getGUIThread();
updates = root().onUpdate((s) -> {
try {
guiThread.processEventsAndUpdate();
} catch (IOException e) {
e.printStackTrace();
}
});
} catch (IOException e) {
e.printStackTrace();
}
}
}
Aggregations