-int i;
-int fmt = SP->slk_format;
-
- for (i = 0; i < slk->labcnt; i++) {
- if (slk->dirty || slk->ent[i].dirty) {
- if (slk->ent[i].visible) {
- if (num_labels > 0 && SLK_STDFMT(fmt))
- {
- if (i < num_labels) {
- TPUTS_TRACE("plab_norm");
- putp(tparm(plab_norm, i+1, slk->ent[i].form_text));
- }
- }
- else
- {
- wmove(slk->win,SLK_LINES(fmt)-1,slk->ent[i].x);
- if (SP && SP->_slk)
- wattrset(slk->win,SP->_slk->attr);
- waddnstr(slk->win,slk->ent[i].form_text,
- MAX_SKEY_LEN(fmt));
- /* if we simulate SLK's, it's looking much more
- natural to use the current ATTRIBUTE also
- for the label window */
- wattrset(slk->win,stdscr->_attrs);
- }
- }
- slk->ent[i].dirty = FALSE;
+ 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) {
+ TPUTS_TRACE("plab_norm");
+ putp(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);
+ if (sp->_slk) {
+ (void) wattrset(slk->win, AttrOf(sp->_slk->attr));
+ }
+ waddstr(slk->win, slk->ent[i].form_text);
+ /* if we simulate SLK's, it's looking much more
+ natural to use the current ATTRIBUTE also
+ for the label window */
+ (void) wattrset(slk->win, WINDOW_ATTRS(StdScreen(sp)));