* Do some initialization for dialog */
| 300 | * Do some initialization for dialog |
| 301 | */ |
| 302 | int init_dialog(const char *backtitle) |
| 303 | { |
| 304 | int height, width; |
| 305 | |
| 306 | initscr(); /* Init curses */ |
| 307 | |
| 308 | /* Get current cursor position for signal handler in mconf.c */ |
| 309 | getyx(stdscr, saved_y, saved_x); |
| 310 | |
| 311 | getmaxyx(stdscr, height, width); |
| 312 | if (height < WINDOW_HEIGTH_MIN || width < WINDOW_WIDTH_MIN) { |
| 313 | endwin(); |
| 314 | return -ERRDISPLAYTOOSMALL; |
| 315 | } |
| 316 | |
| 317 | dlg.backtitle = backtitle; |
| 318 | color_setup(getenv("MENUCONFIG_COLOR")); |
| 319 | |
| 320 | keypad(stdscr, TRUE); |
| 321 | cbreak(); |
| 322 | noecho(); |
| 323 | dialog_clear(); |
| 324 | |
| 325 | return 0; |
| 326 | } |
| 327 | |
| 328 | void set_dialog_backtitle(const char *backtitle) |
| 329 | { |
no test coverage detected