| 1254 | } |
| 1255 | |
| 1256 | const char *ask_string_ncurses(const char *string) |
| 1257 | { |
| 1258 | WINDOW *local_win; |
| 1259 | const int height = 3; |
| 1260 | const int width = 60; |
| 1261 | const int starty = (LINES - height) / 2; /* Calculating for a center placement */ |
| 1262 | const int startx = (COLS - width) / 2; /* of the window */ |
| 1263 | static char response[128]; |
| 1264 | |
| 1265 | local_win = newwin(height, width, starty, startx); |
| 1266 | keypad(local_win, TRUE); /* Need it to get arrow key */ |
| 1267 | box(local_win, 0 , 0); /* 0, 0 gives default characters |
| 1268 | * for the vertical and horizontal |
| 1269 | * lines */ |
| 1270 | wmove(local_win,1,1); |
| 1271 | waddstr(local_win, string); |
| 1272 | wrefresh(local_win); /* Show that box */ |
| 1273 | get_string(local_win, response, 120, NULL); |
| 1274 | wborder(local_win, ' ', ' ', ' ',' ',' ',' ',' ',' '); |
| 1275 | wrefresh(local_win); |
| 1276 | delwin(local_win); |
| 1277 | return &response[0]; |
| 1278 | } |
| 1279 | |
| 1280 | const char *td_curses_version(void) |
| 1281 | { |
no test coverage detected