From: ewt Date: Tue, 6 Aug 1996 20:23:11 +0000 (+0000) Subject: added support for callback X-Git-Tag: v0-9~65 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5809ecab7f31ebca8de8c3bf451dbc9775e0f41a;p=thirdparty%2Fnewt.git added support for callback --- diff --git a/checkbox.c b/checkbox.c index a6dd09b..d554811 100644 --- a/checkbox.c +++ b/checkbox.c @@ -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; }