| 1234567891011121314151617181920212223242526272829303132333435363738 |
- #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;
- }
|