mktags find cpp
[arrow.git] / ncurses / printw.c
blob48c49c808b3ed498e9a12f591f093605cffb1914
1 /* copyleft (C) GPL3 {{{2
2 * Filename: printw.c
4 * Author: arrow <arrow_zhang@sdc.sercomm.com>
5 * Created at: Tue Jan 8 21:12:02 2008
6 * }}}*/
7 /*header files {{{1*/
8 #include <ncurses.h>
9 #include <string.h>
10 #include "debug.h"
11 /*}}}*/
13 /*declaration {{{1*/
14 /*}}}*/
16 /*functions {{{1*/
17 int main(int argc, char *argv[])
19 char mesg[] = "Just a string";
20 int row, col;
22 initscr();
23 getmaxyx(stdscr, row, col);
24 mvprintw(row/2, (col - strlen(mesg))/2, "%s", mesg);
25 mvprintw(row - 2, 0, "This screen has %d rows and %d columns\n", row, col);
26 printw("Try resizing your window(if possible) and then run this program again");
27 refresh();
28 getch();
29 endwin();
31 return 0;
34 /* vim:fdm=marker:ts=8:ft=c:norl:fdl=1:
35 * }}}*/