I have a code that read a form field using ncurses (C++), but i can\'t show a value when the form field isn\'t full typed.
#include
#include
Typically the ncurses form library does not synchronize the field buffer until you leave the field. Since you are attempting to read the buffer before leaving the field the buffer does not have the current content.
A simple way to force the buffer to synchronize without actually moving to the next field is to force field validation -- this will synchronize and then run any validation functions.
Add this line at the begining of your case 10:
form_driver(fo, REQ_VALIDATION);
You might want to check for validation errors:
if (form_driver(fo, REQ_VALIDATION) != E_OK) {
// do something
}