diff options
author | Ludovic Pouzenc <ludovic@pouzenc.fr> | 2011-10-09 12:33:48 +0000 |
---|---|---|
committer | Ludovic Pouzenc <ludovic@pouzenc.fr> | 2011-10-09 12:33:48 +0000 |
commit | 2d91cc4a3b22a1b417ca5f707f137b84262bb4ec (patch) | |
tree | 4b825dc642cb6eb9a060e54bf8d69288fbee4904 /src/essais/test.c | |
parent | 6858221c2c09590dfe05f060f8701f874d2559ac (diff) | |
download | 2011-ddhardrescue-2d91cc4a3b22a1b417ca5f707f137b84262bb4ec.tar.gz 2011-ddhardrescue-2d91cc4a3b22a1b417ca5f707f137b84262bb4ec.tar.bz2 2011-ddhardrescue-2d91cc4a3b22a1b417ca5f707f137b84262bb4ec.zip |
On range tout le code actuel du trunk dans une branche nommée "0.x" et on crée une branche 1.x qui contiendra une nouvelle mouture (re-conception, méta info de packaging...).origin/trunk
git-svn-id: file:///var/svn/2011-ddhardrescue/trunk@29 d3078510-dda0-49f1-841c-895ef4b7ec81
Diffstat (limited to 'src/essais/test.c')
-rw-r--r-- | src/essais/test.c | 86 |
1 files changed, 0 insertions, 86 deletions
diff --git a/src/essais/test.c b/src/essais/test.c deleted file mode 100644 index 3a3e73f..0000000 --- a/src/essais/test.c +++ /dev/null @@ -1,86 +0,0 @@ -#include <ncurses.h> - -WINDOW *create_newwin(int height, int width, int starty, int startx) -{ WINDOW *local_win; - - local_win = newwin(height, width, starty, startx); - wborder(local_win, '|', '|', '-', '-', '+', '+', '+', '+'); -// box(local_win,0,0); - wrefresh(local_win); - return local_win; -} - -int main() { - -/* - A_NORMAL Normal display (no highlight) - A_STANDOUT Best highlighting mode of the terminal. - A_UNDERLINE Underlining - A_REVERSE Reverse video - A_BLINK Blinking - A_DIM Half bright - A_BOLD Extra bright or bold - A_PROTECT Protected mode - A_INVIS Invisible or blank mode - A_ALTCHARSET Alternate character set - A_CHARTEXT Bit-mask to extract a character - COLOR_PAIR(n) Color-pair number n -*/ - int end, ch; - int row,col; - char msg[256]; - WINDOW *w1; - MEVENT event; - - initscr(); - getmaxyx(stdscr,row,col); - raw(); - keypad(stdscr, TRUE); - noecho(); - - start_color(); - init_pair(1, COLOR_WHITE, COLOR_BLUE); - - mousemask(ALL_MOUSE_EVENTS, NULL); -//http://tldp.org/HOWTO/NCURSES-Programming-HOWTO/windows.html - //w1 = create_newwin(row/2, col/2, row/4, col/4); - w1 = create_newwin(10, 10, 10, 10); - attron(COLOR_PAIR(1) | A_BOLD); - mvprintw(row-2,0,"This screen has %d rows and %d columns\n",row,col); - attroff(COLOR_PAIR(1) | A_BOLD); - move(0,0); - - - end=0; - while (!end) { - refresh(); - ch=getch(); - switch(ch) { - case KEY_MOUSE: - if(getmouse(&event) == OK) { /* When the user clicks left mouse button */ - if(event.bstate & BUTTON1_PRESSED) { - attrset(A_NORMAL); - printw("mouse button1\n"); - } - } - break; - case KEY_F(2): - attrset(A_NORMAL); - printw("F2 key\n"); - break; - case 'q': - end=1; - break; - case 'b': - mvwchgat(w1,1,0,-1, A_REVERSE, 0, NULL); - break; - default: - sprintf(msg, "%c key\n", ch); - wattrset(w1,A_BOLD | A_UNDERLINE); - wprintw(w1, msg); - } - } - endwin(); - - return 0; -} |