int bufUsed; /* amount of the buffer that's been used */
int cursorPosition; /* cursor *in the string* on on screen */
int firstChar; /* first character position being shown */
- void * callbackData;
- newtCallback callback;
};
static void entryDraw(newtComponent co);
co->height = 1;
co->width = width;
co->takesFocus = 1;
+ co->callback = NULL;
co->ops = &entryOps;
en->firstChar = 0;
en->bufUsed = 0;
en->bufAlloced = width + 1;
- en->callback = NULL;
if (initialValue && strlen(initialValue) > width) {
en->bufAlloced = strlen(initialValue) + 1;
return co;
}
-void newtEntryAddCallback(newtComponent co, newtCallback f, void * data) {
- struct entry * en = co->data;
-
- en->callback = f;
- en->callbackData = data;
-}
-
static void entryDraw(newtComponent co) {
struct entry * en = co->data;
int i;
/*SLtt_set_cursor_visibility(1);*/
newtGotorc(0, 0);
er.result = ER_SWALLOWED;
- if (en->callback) en->callback(co, en->callbackData);
+ if (co->callback) co->callback(co, co->callbackData);
break;
case EV_KEYPRESS: