enum type type;
char value;
int active, inactive;
+ void * data;
};
static void cbDrawIt(newtComponent c, int active);
} ;
newtComponent newtListitem(int left, int top, char * text, int isDefault,
- newtComponent prevItem) {
+ newtComponent prevItem, void * data) {
newtComponent co;
struct checkbox * li;
li->inactive = COLORSET_LISTBOX;
li->active = COLORSET_ACTLISTBOX;
+ li->data = data;
return co;
}
+void * newtListitemGetData(newtComponent co) {
+ struct checkbox * rb = co->data;
+
+ return rb->data;
+}
+
+void newtListitemSet(newtComponent co, char * text) {
+ struct checkbox * li = co->data;
+
+ free(li->text);
+ li->text = strdup(text);
+
+ if (strlen(text) + 4 > co->width)
+ co->width = strlen(text) + 4;
+}
+
newtComponent newtRadiobutton(int left, int top, char * text, int isDefault,
newtComponent prevButton) {
newtComponent co;