FreeBSD/contrib/ncurses/ncurses/base/lib_slkrefr.c
/*
 * Write the soft labels to the soft-key window.
 */
Write the soft labels to the soft-key window.
Write the soft labels to the soft - key window .
static void
slk_intern_refresh(SCREEN *sp)
{
    int i;
    int fmt;
    SLK *slk;
    int numlab;
    if (sp == 0)
	return;
    slk = sp->_slk;
    fmt = sp->slk_format;
    numlab = NumLabels;
    if (slk->hidden)
	return;
    for (i = 0; i < slk->labcnt; i++) {
	if (slk->dirty || slk->ent[i].dirty) {
	    if (slk->ent[i].visible) {
		if (numlab > 0 && SLK_STDFMT(fmt)) {
#ifdef USE_TERM_DRIVER
		    CallDriver_2(sp, hwlabel, i + 1, slk->ent[i].form_text);
#else
		    if (i < num_labels) {
			NCURSES_PUTP2("plab_norm",
				      TPARM_2(plab_norm,
					      i + 1,
					      slk->ent[i].form_text));
		    }
#endif
		} else {
		    if (fmt == 4)
			slk_paint_info(slk->win);
		    wmove(slk->win, SLK_LINES(fmt) - 1, slk->ent[i].ent_x);
		    (void) wattrset(slk->win, (int) AttrOf(slk->attr));
		    waddstr(slk->win, slk->ent[i].form_text);
		    (void) wattrset(slk->win, (int) WINDOW_ATTRS(StdScreen(sp)));
		}
	    }
	    slk->ent[i].dirty = FALSE;
	}
    }
    slk->dirty = FALSE;
    if (numlab > 0) {
#ifdef USE_TERM_DRIVER
	CallDriver_1(sp, hwlabelOnOff, slk->hidden ? FALSE : TRUE);
#else
	if (slk->hidden) {
	    NCURSES_PUTP2("label_off", label_off);
	} else {
	    NCURSES_PUTP2("label_on", label_on);
	}
#endif
    }
}
static void slk_intern_refresh ( SCREEN * sp ) { int i ; int fmt ; SLK * slk ; int numlab ; if ( sp == 0 ) return ; slk = sp -> _slk ; fmt = sp -> slk_format ; numlab = NumLabels ; if ( slk -> hidden ) return ; for ( i = 0 ; i < slk -> labcnt ; i ++ ) { if ( slk -> dirty || slk -> ent [ i ] . dirty ) { if ( slk -> ent [ i ] . visible ) { if ( numlab > 0 && SLK_STDFMT ( fmt ) ) { #ifdef USE_TERM_DRIVER CallDriver_2 ( sp , hwlabel , i + 1 , slk -> ent [ i ] . form_text ) ; #else if ( i < num_labels ) { NCURSES_PUTP2 ( " " , TPARM_2 ( plab_norm , i + 1 , slk -> ent [ i ] . form_text ) ) ; } #endif } else { if ( fmt == 4 ) slk_paint_info ( slk -> win ) ; wmove ( slk -> win , SLK_LINES ( fmt ) - 1 , slk -> ent [ i ] . ent_x ) ; ( void ) wattrset ( slk -> win , ( int ) AttrOf ( slk -> attr ) ) ; waddstr ( slk -> win , slk -> ent [ i ] . form_text ) ; ( void ) wattrset ( slk -> win , ( int ) WINDOW_ATTRS ( StdScreen ( sp ) ) ) ; } } slk -> ent [ i ] . dirty = FALSE ; } } slk -> dirty = FALSE ; if ( numlab > 0 ) { #ifdef USE_TERM_DRIVER CallDriver_1 ( sp , hwlabelOnOff , slk -> hidden ? FALSE : TRUE ) ; #else if ( slk -> hidden ) { NCURSES_PUTP2 ( " " , label_off ) ; } else { NCURSES_PUTP2 ( " " , label_on ) ; } #endif } }
Write the soft labels to the soft-key window.
Write the soft labels to the soft - key window .
/* if we simulate SLK's, it's looking much more
		       natural to use the current ATTRIBUTE also
		       for the label window */