Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // This prints a red '>' in the inputLine window properly. //
- wattron(inputLine, A_BOLD | COLOR_PAIR(COLOR_RED));
- wprintw(inputLine, "n> ");
- wattroff(inputLine, A_BOLD | COLOR_PAIR(COLOR_RED));
- // This prints a light grey "Le Testing." to stdscr. Why isn't it red? //
- wattron(stdscr, A_BOLD | COLOR_PAIR(COLOR_RED));
- cout << "nLe Testing.n";
- wattroff(stdscr, A_BOLD | COLOR_PAIR(COLOR_RED));
- // This does nothing. I have no idea why. //
- wattron(stdscr, A_BOLD | COLOR_PAIR(COLOR_RED));
- wprintw(stdstc, "nLe Testing.n");
- wattroff(stdscr, A_BOLD | COLOR_PAIR(COLOR_RED));
- // Open the output log which will mimic stdout. //
- if (userPath)
- {
- string filename = string(userPath) + LOG_FILENAME;
- log.open(filename.c_str());
- }
- // Initialize the pdCurses screen. //
- initscr();
- // Resize the stdout screen and create a line for input. //
- resize_window(stdscr, LINES - 1, COLS);
- inputLine = newwin(1, COLS, LINES - 1, 0);
- // Initialize colors. //
- if (has_colors())
- {
- start_color();
- for (int i = 1; i <= COLOR_WHITE; ++i)
- {
- init_pair(i, i, COLOR_BLACK);
- }
- }
- else
- {
- cout << "Terminal cannot print colors.n";
- if (log.is_open())
- log << "Terminal cannot print colors.n";
- }
- scrollok(stdscr, true);
- scrollok(inputLine, true);
- leaveok(stdscr, true);
- leaveok(inputLine, true);
- nodelay(inputLine, true);
- cbreak();
- noecho();
- keypad(inputLine, true);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement