Curseshelper. structures for settings
This commit is contained in:
25
curseshelper.c
Normal file
25
curseshelper.c
Normal 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);
|
||||
}
|
Reference in New Issue
Block a user