4 #include "term-curses.h"
6 #define MAX_FIELD_SIZE 64
18 /* NB: LABEL must stay the first entry, as it is used to test if we have
19 * an object or an entry */
27 /* This is the type of the action to be executed when the entry has been
28 * successfully selected (in case of a menuentry) or filled (in case of a
30 typedef int(*action_fn_type)(char *);
33 typedef struct entry {
35 char *data; /* contains label or submenu title */
36 action_fn_type action;
40 typedef struct object {
44 int alloced; /* defines the current size of entries */
45 int last; /* index of the first non-alloced entry */
49 /* Object definitions */
51 object *create_menu (char *title);
52 object *create_form (char *title);
53 /* entries must be NULL terminated */
54 object *create_list (char *title, entry **entries);
57 entry *create_menuentry (char *label, action_fn_type action);
58 entry *create_label (char *label);
59 entry *create_field (char *label, action_fn_type action);
61 void attach_submenu (object *father, object *child);
62 void attach_entry (object *father, void *child);
64 void display_object (object *obj);
68 #endif /* __CUIX_API_H */