]> git.ipfire.org Git - thirdparty/newt.git/commitdiff
- add newtSetColor()
authormlichvar <mlichvar>
Wed, 28 Feb 2007 17:35:01 +0000 (17:35 +0000)
committermlichvar <mlichvar>
Wed, 28 Feb 2007 17:35:01 +0000 (17:35 +0000)
newt.0.52.ver
newt.c
newt.h

index 3bb4d7b08fe2ee9b648278413079538b97dbfdda..fe9bdd388b59f2d0fc085e1a052a682bc1791d2b 100644 (file)
@@ -138,5 +138,6 @@ NEWT_0.52 {
 
 NEWT_0.52.6 {
        global:
+               newtSetColor;
                newtPopWindowNoRefresh;
 } NEWT_0.52;
diff --git a/newt.c b/newt.c
index a74c10750504e7c2f179159dbbf03e3bc09fe47b..544558da889ac6c451b3e3b2e89eb2aaff0f811a 100644 (file)
--- a/newt.c
+++ b/newt.c
@@ -398,6 +398,14 @@ void newtSetColors(struct newtColors colors) {
                   colors.selListboxBg);
 }
 
+void newtSetColor(int colorset, char *fg, char *bg) {
+    if (colorset < NEWT_COLORSET_ROOT || colorset > NEWT_COLORSET_SELLISTBOX ||
+           !SLtt_Use_Ansi_Colors)
+       return;
+
+    SLtt_set_color(colorset, "", fg, bg);
+}
+
 /* Keymap handling - rewritten by Henning Makholm <henning@makholm.net>,
  * November 2003.
  */
diff --git a/newt.h b/newt.h
index da16afe9e77ad8eedb8aed64269bf38a7a09bde0..daa55138db12c0da418e52fee5c3914ce79d88e9 100644 (file)
--- a/newt.h
+++ b/newt.h
@@ -122,6 +122,7 @@ int newtCenteredWindow(unsigned int width,unsigned int height, const char * titl
 void newtPopWindow(void);
 void newtPopWindowNoRefresh(void);
 void newtSetColors(struct newtColors colors);
+void newtSetColor(int colorset, char *fg, char *bg);
 void newtRefresh(void);
 void newtSuspend(void);
 void newtSetSuspendCallback(newtSuspendCallback cb, void * data);