void initcurses() { /* Initialize curses */ initscr(); /* Don't echo keys */ noecho(); raw(); /* Allow arrows and other weird keys */ keypad(stdscr, true); /* Refresh the standard screen */ refresh(); lifecols = COLS-ICOLS-1; /* Leave one column empty */ lifelines = LINES; /* Full height */ /* Create the two windows */ life = createwin(lifelines, lifecols, 0, 0); info = createwin(ILINES, ICOLS, 0, lifecols+1); /* Make a default box around the info-window */ box(info, 0, 0); /* Move, window, printw; Write to window info and move the cursor to 1,1 * before writing. */ mvwprintw(info, 1,1, "INFO"); /* Move the cursor back to game area. The user don't need to see the cursor * jumping to the info-window */ wmove(life, 1,1); /* Refresh both of the windows */ wrefresh(info); wrefresh(life); }
void init_curses() { initscr(); noecho(); timeout(touti); //raw(); /* Refresh standart screen */ refresh(); // Creating windows life = createwin(MLMAX, MCMAX, MLMIN, MCMIN); info = createwin(PLINES, PCOLS, 0, COLS-PCOLS); box(info, 0, 0); // default box around info-window box(life, 0, 0); // default box around life-window /* Move cursor to info-window at 1,1 position and * write header. */ mvwprintw(info, 1, 1, "INFO"); /* Move cursor back to view area */ wmove(life, 2,2); // refresh windows wrefresh(info); wrefresh(life); info_status(0); }
void main(void) { char c; do { clrscr(); window(25,5,54,12); textbackground(7); textcolor(3); clrscr(); window(25,5,54,20); gotoxy(1,1); createwin(); textcolor(0); window(26,6,53,13); gotoxy(1,3); cputs(" Запись в файл\n\r"); cputs(" Обработка файла\n\r"); cputs(" cортировка по Алфавиту\n\r"); cputs(" сортировка по Dлине\n\r"); cputs(" Просмотр файла\n\r"); cputs(" Выход\n\r"); textbackground(0); window(1,1,80,25); gotoxy(23,1); textcolor(15); cputs("КУРСОВАЯ РАБОТА ПО ПРОГРАММИРОВАНИЮ"); gotoxy(29,24); cputs("(C) ПАВЕЛ СКРЫЛЕВ 1995"); c=getch(); switch (c) { case 'c':enter(); break; case 'g':look(); break; case 'f':alf(); break; case 'l':length(); break; case 'j':kb(); break; } } while(c!='d'); clrscr(); cputs("Course work for a course of Programming by Skrylev Pavel (C)1995"); }