]> git.ipfire.org Git - thirdparty/newt.git/commitdiff
added support for callback
authorewt <ewt>
Tue, 6 Aug 1996 20:23:11 +0000 (20:23 +0000)
committerewt <ewt>
Tue, 6 Aug 1996 20:23:11 +0000 (20:23 +0000)
checkbox.c

index a6dd09b306e5fe03c4e9ce2b4fa663e05457d5c8..d5548118f9124340700970b07d1632444a2f4d56 100644 (file)
@@ -128,6 +128,7 @@ newtComponent newtCheckbox(int left, int top, char * text, char defValue,
 
     co->ops = &cbOps;
 
+    co->callback = NULL;
     co->height = 1;
     co->width = strlen(text) + 4;
     co->top = top;
@@ -230,10 +231,14 @@ struct eventResult cbEvent(struct newtComponent * co, struct event ev) {
            } else {
                er.result = ER_IGNORED;
            }
+           break;
        }
     } else 
        er.result = ER_IGNORED;
 
+    if (er.result == ER_SWALLOWED && co->callback)
+       co->callback(co, co->callbackData);
+
     return er;
 }