]> git.ipfire.org Git - thirdparty/newt.git/blobdiff - test.c
install python modules to purelib and platlib
[thirdparty/newt.git] / test.c
diff --git a/test.c b/test.c
index 50483ac8802bc255475b65d94598a18729ee0191..5a6958c390e7334cc2be24a17731fab959d4cef2 100644 (file)
--- a/test.c
+++ b/test.c
@@ -34,7 +34,7 @@ void helpCallback(newtComponent co, void * tag) {
 
 int main(void) {
     newtComponent b1, b2, r1, r2, r3, e2, e3, l1, l2, l3, scale;
-    newtComponent lb, t, rsf, answer, timeLabel;
+    newtComponent lb, t, rsf, timeLabel;
     newtComponent cs[10];
     newtComponent f, chklist, e1;
     struct callbackInfo cbis[3];
@@ -129,7 +129,6 @@ int main(void) {
        if (es.reason == NEWT_EXIT_COMPONENT && es.u.co == b2) {
            newtScaleSet(scale, atoi(scaleVal));
            newtRefresh();
-           answer = NULL;
        } else if (es.reason == NEWT_EXIT_TIMER) {
            spinState++;
            if (!*spinState) spinState = spinner;
@@ -138,14 +137,9 @@ int main(void) {
        }
     } while (es.reason != NEWT_EXIT_COMPONENT || es.u.co == b2);
 
-    scaleVal = strdup(scaleVal);
-    enr2 = strdup(enr2);
-    enr3 = strdup(enr3);
-
+    numsel = 0;
     selectedList = newtListboxGetSelection(lb, &numsel);
 
-    newtFormDestroy(f);
-
     newtPopWindow();
     newtPopWindow();
     newtFinished();
@@ -154,11 +148,14 @@ int main(void) {
     printf("got string 2: %s\n", enr2);
     printf("got string 3: %s\n", enr3);
 
+    newtFormDestroy(f);
+
     printf("\nSelected listbox items (%d):\n", numsel);
     if(selectedList) {
        for(i = 0; i < numsel; i++)
            printf("#%d\n", (int)(long) selectedList[i]);
     }
+    free(selectedList);
 
     return 0;
 }