]> git.ipfire.org Git - thirdparty/newt.git/commitdiff
added textbox widget
authorewt <ewt>
Wed, 17 Apr 1996 00:38:48 +0000 (00:38 +0000)
committerewt <ewt>
Wed, 17 Apr 1996 00:38:48 +0000 (00:38 +0000)
newt.c
newt.h

diff --git a/newt.c b/newt.c
index a49cc160f2328faabcc378be526bb74960d65fb7..1c7cca414c0a0990e9e8d83eed4aee83802fc1a6 100644 (file)
--- a/newt.c
+++ b/newt.c
@@ -41,6 +41,8 @@ struct newtColors newtDefaultColorPalette = {
        "blue", "lightgray",                    /* label fg, bg */
        "red", "lightgray",                     /* listbox fg, bg */
        "lightgray", "red",                     /* active listbox fg, bg */
+       "red", "lightgray",                     /* textbox fg, bg */
+       "lightgray", "red",                     /* active textbox fg, bg */
 };
 
 static struct keymap keymap[] = {
@@ -128,6 +130,9 @@ void newtSetColors(struct newtColors colors) {
     SLtt_set_color(COLORSET_LISTBOX, "", colors.listboxFg, colors.listboxBg);
     SLtt_set_color(COLORSET_ACTLISTBOX, "", colors.actListboxFg, 
                                            colors.actListboxBg);
+    SLtt_set_color(COLORSET_TEXTBOX, "", colors.textboxFg, colors.textboxBg);
+    SLtt_set_color(COLORSET_ACTTEXTBOX, "", colors.actTextboxFg, 
+                                           colors.actTextboxBg);
 }
 
 int newtGetKey(void) {
diff --git a/newt.h b/newt.h
index ae9d874c265c2d3908107aed8a10f4df526c455a..62e70ae05bc0e419d7b18a9851ba7f7b394e07f2 100644 (file)
--- a/newt.h
+++ b/newt.h
@@ -15,6 +15,8 @@ struct newtColors {
     char * labelFg, * labelBg;
     char * listboxFg, * listboxBg;
     char * actListboxFg, * actListboxBg;
+    char * textboxFg, * textboxBg;
+    char * actTextboxFg, * actTextboxBg;
 };
 
 extern struct newtColors newtDefaultColorPalette;
@@ -52,6 +54,12 @@ void newtScrollbarSet(newtComponent co, int where, int total);
 newtComponent newtListbox(int left, int top, int height, int flags);
 void newtListboxAddEntry(newtComponent co, char * text);
 
+#define NEWT_TEXTBOX_WRAP      (1 << 0)
+#define NEWT_TEXTBOX_SCROLL    (1 << 1)
+
+newtComponent newtTextbox(int left, int top, int with, int height, int flags);
+void newtTextboxSetText(newtComponent co, const char * text);
+
 newtComponent newtForm(newtComponent vertBar);
 void newtFormAddComponent(newtComponent form, newtComponent co);
 void newtFormAddComponents(newtComponent form, ...);