コード例 #1
0
/*
 * Display and/or allow update for the properties accessed in the opaque
 * window.  Some may change state after refreshing the window, so we
 * distinguish between them using the 'before' parameter.
 */
static int
show_opaque(WINDOW *stswin, WINDOW *txtwin, bool before, int active)
{
    int n;
    int top, bottom;

    if (before) {
	werase(stswin);
    }
    for (n = 0; n < (int) SIZEOF(bool_funcs); ++n) {
	show_keyword(stswin, n, active, bool_funcs[n].name);

	to_result(stswin, n, before);
	wprintw(stswin, "%c", bool_funcs[n].func(txtwin, -1) ? 'T' : 'F');
    }

    show_keyword(stswin, n, active, "wgetparent");
    to_result(stswin, n, TRUE);
    wprintw(stswin, "%p", (void *) wgetparent(txtwin));

    ++n;
    show_keyword(stswin, n, active, "wgetscrreg");
    to_result(stswin, n, TRUE);
    if (wgetscrreg(txtwin, &top, &bottom) == OK)
	wprintw(stswin, "%d,%d", top, bottom);

    wnoutrefresh(stswin);
    return active;
}
コード例 #2
0
ファイル: curs_spec.c プロジェクト: guildhall/guile-ncurses
/* Return the range of the lines in the scroll region */
SCM
gucu_getscrreg (SCM win)
{
  int top, bottom;

  wgetscrreg (_scm_to_window (win), &top, &bottom);

  return (scm_list_2 (scm_from_int (top), scm_from_int (bottom)));
}