]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - ncurses/base/lib_slkatr_set.c
ncurses 5.0
[ncurses.git] / ncurses / base / lib_slkatr_set.c
similarity index 66%
rename from menu/m_adabind.c
rename to ncurses/base/lib_slkatr_set.c
index a6167c2c75535112be7d0bf1ee1edf2804288212..0695d186bb5d97b061bb2148ce3c5809128ab832 100644 (file)
  ****************************************************************************/
 
 /****************************************************************************
- *   Author: Juergen Pfeifer <Juergen.Pfeifer@T-Online.de> 1995,1997        *
+ *  Author: Juergen Pfeifer <juergen.pfeifer@gmx.net> 1998                  *
  ****************************************************************************/
 
-/***************************************************************************
-* Module m_adabind.c                                                       *
-* Helper routines to ease the implementation of an Ada95 binding to        *
-* ncurses. For details and copyright of the binding see the ../Ada95       *
-* subdirectory.                                                            *
-***************************************************************************/
-#include "menu.priv.h"
+/*
+ *     lib_slkatr_set.c
+ *     Soft key routines.
+ *      Set the labels attributes
+ */
+#include <curses.priv.h>
 
-MODULE_ID("$Id: m_adabind.c,v 1.6 1998/02/11 12:13:50 tom Exp $")
+MODULE_ID("$Id: lib_slkatr_set.c,v 1.3 1999/05/16 17:13:59 juergen Exp $")
 
-/* Prototypes for the functions in this module */
-void  _nc_ada_normalize_menu_opts (int *opt);
-void  _nc_ada_normalize_item_opts (int *opt);
-ITEM* _nc_get_item(const MENU*, int);
-
-void _nc_ada_normalize_menu_opts (int *opt)
+int
+slk_attr_set(const attr_t attr, short color_pair_number, void* opts)
 {
-  *opt = ALL_MENU_OPTS & (*opt);
-}
-
-void _nc_ada_normalize_item_opts (int *opt)
-{
-  *opt = ALL_ITEM_OPTS & (*opt);
-}
+  T((T_CALLED("slk_attr_set(%s,%d)"), _traceattr(attr), color_pair_number));
 
-ITEM* _nc_get_item(const MENU* menu, int idx) {
-  if (menu && menu->items && idx>=0 && (idx<menu->nitems))
+  if (SP!=0 && SP->_slk!=0 && !opts &&
+      color_pair_number>=0 && color_pair_number<COLOR_PAIRS)
     {
-      return menu->items[idx];
+      SP->_slk->attr = attr;
+      toggle_attr_on(SP->_slk->attr,COLOR_PAIR(color_pair_number));
+      returnCode(OK);
     }
   else
-    return (ITEM*)0;
+    returnCode(ERR);
 }