changed structure
This commit is contained in:
Executable
BIN
Binary file not shown.
@@ -0,0 +1,38 @@
|
||||
#include <ncurses.h>
|
||||
#include <stdio.h>
|
||||
|
||||
|
||||
|
||||
int main(){
|
||||
initscr();
|
||||
noecho();
|
||||
cbreak();
|
||||
keypad(stdscr, TRUE);
|
||||
curs_set(1);
|
||||
|
||||
if(has_colors() == FALSE ) {
|
||||
endwin();
|
||||
puts("no colors");
|
||||
return 1;
|
||||
}
|
||||
|
||||
start_color();
|
||||
init_pair(1, COLOR_WHITE, COLOR_BLUE);
|
||||
attron(COLOR_PAIR(1));
|
||||
|
||||
int y,x;
|
||||
getmaxyx(stdscr, y,x);
|
||||
y=y*0.5;
|
||||
x=(x*0.5) -6;
|
||||
mvwprintw(stdscr, y, x, "Hello World");
|
||||
mvwprintw(stdscr, 2, 2, "Hellow World1");
|
||||
refresh();
|
||||
|
||||
attroff(COLOR_PAIR(1));
|
||||
|
||||
getch();
|
||||
|
||||
endwin();
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user