]> git.ipfire.org Git - thirdparty/newt.git/commitdiff
added listbox test
authorewt <ewt>
Wed, 27 Mar 1996 17:46:08 +0000 (17:46 +0000)
committerewt <ewt>
Wed, 27 Mar 1996 17:46:08 +0000 (17:46 +0000)
test.c

diff --git a/test.c b/test.c
index 4142498b2541f8a03e798fdc083c7544c169ed73..b68d89142fd097dde1b6559871e63c4cbbfb7432 100644 (file)
--- a/test.c
+++ b/test.c
@@ -6,6 +6,7 @@
 
 void main(void) {
     newtComponent b1, b2, r1, r2, r3, e1, e2, e3, l1, l2, l3;
+    newtComponent lb;
     newtComponent cs[10];
     newtComponent f, chklist;
     char results[10];
@@ -16,8 +17,8 @@ void main(void) {
     newtInit();
     newtCls();
 
-    newtOpenWindow(2, 5, 30, 10, "first window");
-    newtOpenWindow(20, 10, 40, 13, "window 2");
+    newtOpenWindow(2, 2, 30, 10, "first window");
+    newtOpenWindow(10, 5, 65, 16, "window 2");
 
     f = newtForm();
     chklist = newtForm();
@@ -41,11 +42,19 @@ void main(void) {
     e2 = newtEntry(12, 11, "Default", 20, &enr2, NEWT_ENTRY_SCROLL);
     e3 = newtEntry(12, 12, NULL, 20, &enr3, NEWT_ENTRY_HIDDEN);
 
-    newtFormSetSize(chklist, 13, 3);
+    newtFormSetHeight(chklist, 3);
 
     newtFormAddComponents(f, b1, b2, chklist, NULL);
     newtFormAddComponents(f, r1, r2, r3, l1, l2, l3, e1, e2, e3, NULL);
 
+    lb = newtListbox(45, 3, 2, 0);
+    newtListboxAddEntry(lb, "First ");
+    newtListboxAddEntry(lb, "Second");
+    newtListboxAddEntry(lb, "Third ");
+    newtListboxAddEntry(lb, "Fourth");
+
+    newtFormAddComponent(f, lb);
+
     newtRunForm(f);
  
     enr1 = strdup(enr1);