src/pspg.c
void
show_info_wait(const char *fmt,
			   const char *par,
			   bool beep,
			   bool refresh_first,
			   bool applytimeout,
			   bool is_error)
{
	attr_t  att;
	int		event;
	int		timeout = -1;
	NCursesEventData nced;

	/*
	 * When refresh is required first, then store params and quit immediately.
	 * Only once can be info moved after refresh
	 */
	if (refresh_first && current_state->fmt == NULL)
	{
		if (fmt != NULL)
			current_state->fmt = sstrdup(fmt);
		else
			current_state->fmt = NULL;

		if (par != NULL)
			current_state->par = sstrdup(par);
		else
			current_state->par = NULL;
		current_state->beep = beep;
		current_state->applytimeout = applytimeout;
		current_state->is_error = is_error;

		return;
	}

	att = !is_error ? prompt_window_info_attr : prompt_window_error_attr;

	wattron(prompt_window, att);

	if (par != NULL)
		mvwprintw(prompt_window, 0, 0, fmt, par);
	else
		mvwprintw(prompt_window, 0, 0, "%s", fmt);

	if (!applytimeout)
		wprintw(prompt_window, " (press any key)");

	if (par)
		log_row(fmt, par);
	else
		log_row(fmt);

	wclrtoeol(prompt_window);
	mvwchgat(prompt_window, 0, 0, -1, att, PAIR_NUMBER(att), 0);

	wattroff(prompt_window,  att);
	wnoutrefresh(prompt_window);

	doupdate();

	if (beep)
		make_beep();

	if (applytimeout)
		timeout = strlen(fmt) < 50 ? 3000 : 6000;

	event = get_pspg_event(&nced, true, timeout);

	/*
	 * Screen should be refreshed after show any info.
	 */
	current_state->refresh_scr = true;

	/* eat escape if pressed here */
	if (event == PSPG_NCURSES_EVENT &&
		!(nced.keycode == 27 && nced.alt))
		unget_pspg_event(&nced);
}
/*
 * It is used for result of action info
 */
It is used for result of action info
It is used for result of action info
void
show_info_wait(const char *fmt,
			   const char *par,
			   bool beep,
			   bool refresh_first,
			   bool applytimeout,
			   bool is_error)
{
	attr_t  att;
	int		event;
	int		timeout = -1;
	NCursesEventData nced;
	if (refresh_first && current_state->fmt == NULL)
	{
		if (fmt != NULL)
			current_state->fmt = sstrdup(fmt);
		else
			current_state->fmt = NULL;
		if (par != NULL)
			current_state->par = sstrdup(par);
		else
			current_state->par = NULL;
		current_state->beep = beep;
		current_state->applytimeout = applytimeout;
		current_state->is_error = is_error;
		return;
	}
	att = !is_error ? prompt_window_info_attr : prompt_window_error_attr;
	wattron(prompt_window, att);
	if (par != NULL)
		mvwprintw(prompt_window, 0, 0, fmt, par);
	else
		mvwprintw(prompt_window, 0, 0, "%s", fmt);
	if (!applytimeout)
		wprintw(prompt_window, " (press any key)");
	if (par)
		log_row(fmt, par);
	else
		log_row(fmt);
	wclrtoeol(prompt_window);
	mvwchgat(prompt_window, 0, 0, -1, att, PAIR_NUMBER(att), 0);
	wattroff(prompt_window,  att);
	wnoutrefresh(prompt_window);
	doupdate();
	if (beep)
		make_beep();
	if (applytimeout)
		timeout = strlen(fmt) < 50 ? 3000 : 6000;
	event = get_pspg_event(&nced, true, timeout);
	current_state->refresh_scr = true;
	if (event == PSPG_NCURSES_EVENT &&
		!(nced.keycode == 27 && nced.alt))
		unget_pspg_event(&nced);
}
void show_info_wait ( const char * fmt , const char * par , bool beep , bool refresh_first , bool applytimeout , bool is_error ) { attr_t att ; int event ; int timeout = -1 ; NCursesEventData nced ; if ( refresh_first && current_state -> fmt == NULL ) { if ( fmt != NULL ) current_state -> fmt = sstrdup ( fmt ) ; else current_state -> fmt = NULL ; if ( par != NULL ) current_state -> par = sstrdup ( par ) ; else current_state -> par = NULL ; current_state -> beep = beep ; current_state -> applytimeout = applytimeout ; current_state -> is_error = is_error ; return ; } att = ! is_error ? prompt_window_info_attr : prompt_window_error_attr ; wattron ( prompt_window , att ) ; if ( par != NULL ) mvwprintw ( prompt_window , 0 , 0 , fmt , par ) ; else mvwprintw ( prompt_window , 0 , 0 , " " , fmt ) ; if ( ! applytimeout ) wprintw ( prompt_window , " " ) ; if ( par ) log_row ( fmt , par ) ; else log_row ( fmt ) ; wclrtoeol ( prompt_window ) ; mvwchgat ( prompt_window , 0 , 0 , -1 , att , PAIR_NUMBER ( att ) , 0 ) ; wattroff ( prompt_window , att ) ; wnoutrefresh ( prompt_window ) ; doupdate ( ) ; if ( beep ) make_beep ( ) ; if ( applytimeout ) timeout = strlen ( fmt ) < 50 ? 3000 : 6000 ; event = get_pspg_event ( & nced , true , timeout ) ; current_state -> refresh_scr = true ; if ( event == PSPG_NCURSES_EVENT && ! ( nced . keycode == 27 && nced . alt ) ) unget_pspg_event ( & nced ) ; }
It is used for result of action info
It is used for result of action info
/*
	 * When refresh is required first, then store params and quit immediately.
	 * Only once can be info moved after refresh
	 */ /*
	 * Screen should be refreshed after show any info.
	 */ /* eat escape if pressed here */