ui/ui/tree.h

changeset 42
29b2821d1262
parent 39
4e66271541e8
child 58
2b124f8ebd95
equal deleted inserted replaced
41:394f3b06dba1 42:29b2821d1262
33 33
34 #ifdef __cplusplus 34 #ifdef __cplusplus
35 extern "C" { 35 extern "C" {
36 #endif 36 #endif
37 37
38 typedef struct UiModelInfo UiModelInfo; 38 typedef struct UiModelInfo UiModelInfo;
39 typedef struct UiListSelection UiListSelection;
39 40
40 typedef enum UiModelType UiModelType; 41 typedef enum UiModelType UiModelType;
41 42
42 enum UiModelType { 43 enum UiModelType {
43 UI_STRING = 0, 44 UI_STRING = 0,
71 void*(*getvalue)(void*, int); 72 void*(*getvalue)(void*, int);
72 73
73 /* 74 /*
74 * selection callback 75 * selection callback
75 */ 76 */
76 ui_callback callback; 77 ui_callback activate;
77 78
78 /* 79 /*
79 * userdata for callback 80 * cursor callback
81 */
82 ui_callback selection;
83
84 /*
85 * userdata for both callback
80 */ 86 */
81 void *userdata; 87 void *userdata;
88 };
89
90 struct UiListSelection {
91 /*
92 * number of selected items
93 */
94 int count;
95
96 /*
97 * indices of selected rows
98 */
99 int *rows;
82 }; 100 };
83 101
84 UiModelInfo* ui_model_info(UiContext *ctx, ...); 102 UiModelInfo* ui_model_info(UiContext *ctx, ...);
85 void ui_model_info_free(UiContext *ctx, UiModelInfo *mi); 103 void ui_model_info_free(UiContext *ctx, UiModelInfo *mi);
86 104

mercurial