Curseshelper. structures for settings

This commit is contained in:
2018-03-26 11:50:10 +02:00
parent 6a4b0fd126
commit 6519092f7c
6 changed files with 56 additions and 10 deletions

25
curseshelper.c Normal file
View File

@@ -0,0 +1,25 @@
#include <string.h>
#include <ncurses.h>
#include "curseshelper.h"
void printCenter(const char *text) {
int x, y;
getmaxyx(stdscr, y, x);
int centery = --y / 2;
int centerx = (--x - (strlen(text) / 2)) / 2;
mvprintw(centery, centerx, text);
}
void printCenterOffset(const char *text, int offsety) {
int x, y;
getmaxyx(stdscr, y, x);
int centery = (--y + offsety) / 2;
int centerx = (--x - (strlen(text) / 2)) / 2;
mvprintw(centery, centerx, text);
}