From f44348aced7b4db8d4afe75b1fb20a2436232c22 Mon Sep 17 00:00:00 2001 From: William McBrine Date: Mon, 12 Dec 2005 04:09:49 +0000 Subject: [PATCH] slk_color(), after slk_attrset(). Not tested. --- curses.h | 3 ++- pdcurses/slk.c | 28 +++++++++++++++++++++++++++- 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/curses.h b/curses.h index 21cb41bc..e81f6c0d 100644 --- a/curses.h +++ b/curses.h @@ -18,7 +18,7 @@ *************************************************************************** */ /* -$Id: curses.h,v 1.48 2005/12/12 00:26:57 wmcbrine Exp $ +$Id: curses.h,v 1.49 2005/12/12 04:09:49 wmcbrine Exp $ */ /* *---------------------------------------------------------------------- @@ -1760,6 +1760,7 @@ int PDC_CDECL slk_touch Args((void)); int PDC_CDECL slk_attron Args((attr_t)); int PDC_CDECL slk_attrset Args((attr_t)); int PDC_CDECL slk_attroff Args((attr_t)); +int PDC_CDECL slk_color Args((short)); WINDOW* PDC_CDECL subpad Args(( WINDOW*, int, int, int, int )); WINDOW* PDC_CDECL subwin Args(( WINDOW*, int, int, int, int )); int PDC_CDECL syncok Args((WINDOW*, bool)); diff --git a/pdcurses/slk.c b/pdcurses/slk.c index f5b4711e..caf980e5 100644 --- a/pdcurses/slk.c +++ b/pdcurses/slk.c @@ -36,13 +36,14 @@ #undef slk_attron #undef slk_attrset #undef slk_attroff +#undef slk_color /* undefine any macros for functions called by this module if in debug mode */ #ifdef PDCDEBUG #endif #ifdef PDCDEBUG -char *rcsid_slk = "$Id: slk.c,v 1.3 2005/11/19 19:07:21 wmcbrine Exp $"; +char *rcsid_slk = "$Id: slk.c,v 1.4 2005/12/12 04:09:49 wmcbrine Exp $"; #endif /*man-start********************************************************************* @@ -62,6 +63,7 @@ char *rcsid_slk = "$Id: slk.c,v 1.3 2005/11/19 19:07:21 wmcbrine Exp $"; int slk_attron(attr_t attrs); int slk_attrset(attr_t attrs); int slk_attroff(attr_t attrs); + int slk_color(short color_pair); X/Open Description: These functions manipulate a window that contain Soft Label Keys (SLK). @@ -555,6 +557,30 @@ attr_t attrs; } +/***********************************************************************/ +#ifdef HAVE_PROTO +int PDC_CDECL slk_color(short color_pair) +#else +int PDC_CDECL slk_color(color_pair) +short color_pair; +#endif +/***********************************************************************/ +{ + int i,rc; +#ifdef PDCDEBUG + if (trace_on) PDC_debug("slk_color() - called\n"); +#endif + + rc = wcolor_set(SP->slk_winptr, color_pair, NULL); + for (i = 0; i < labels; ++i) + { + PDC_slk_set(i + 1, slk_save[i].label, slk_save[i].format, 0); + } + + return rc; + +} + /***********************************************************************/ #ifdef HAVE_PROTO static void PDC_slk_init(void)