当前位置:首页 > 实验3 Linux Shell程序设计
int track = 1; intscreen_line = 1; WINDOW *box_window_ptr; WINDOW *sub_window_ptr; clear_all_screen(); mvprintw(PROMPT_LINE, 0, \ if (!get_confirm()) return; move(PROMPT_LINE, 0); clrtoeol(); remove_tracks(); mvprintw(MESSAGE_LINE, 0, \ tracks_fp = fopen(tracks_file, \ /* Just to show how, enter the information in a scrolling, boxed, window. The trick is to set-up a sub-window, draw a box around the edge, then add a new, scrolling, sub-window just inside the boxed sub-window. */ box_window_ptr = subwin(stdscr, BOXED_LINES + 2, BOXED_ROWS + 2, sub_window_ptr = subwin(stdscr, BOXED_LINES, BOXED_ROWS, BOX_LINE_POS, BOX_ROW_POS); if (!sub_window_ptr) return; scrollok(sub_window_ptr, TRUE); werase(sub_window_ptr); touchwin(stdscr); do { mvwprintw(sub_window_ptr, screen_line++, BOX_ROW_POS + 2, \clrtoeol(); refresh(); wgetnstr(sub_window_ptr, track_name, MAX_STRING); len = strlen(track_name); track); BOX_LINE_POS - 1, BOX_ROW_POS - 1); if (!box_window_ptr) return; box(box_window_ptr, ACS_VLINE, ACS_HLINE); if (len> 0 &&track_name[len - 1] == '\\n') track_name[len - 1] = '\\0'; if (*track_name) fprintf(tracks_fp, \track++; if (screen_line> BOXED_LINES - 1) { /* time to start scrolling */ scroll(sub_window_ptr); screen_line--; } } while (*track_name); delwin(sub_window_ptr); fclose(tracks_fp); }
3、实验记录
(1) 实验过程:
1. 使用vim打开一个ex4.c文件,并编辑
共分享92篇相关文档