diff -r 394f3b06dba1 -r 29b2821d1262 ui/ui/tree.h --- a/ui/ui/tree.h Thu May 15 22:13:25 2014 +0200 +++ b/ui/ui/tree.h Fri May 16 16:19:46 2014 +0200 @@ -35,7 +35,8 @@ extern "C" { #endif -typedef struct UiModelInfo UiModelInfo; +typedef struct UiModelInfo UiModelInfo; +typedef struct UiListSelection UiListSelection; typedef enum UiModelType UiModelType; @@ -73,14 +74,31 @@ /* * selection callback */ - ui_callback callback; + ui_callback activate; + + /* + * cursor callback + */ + ui_callback selection; /* - * userdata for callback + * userdata for both callback */ void *userdata; }; +struct UiListSelection { + /* + * number of selected items + */ + int count; + + /* + * indices of selected rows + */ + int *rows; +}; + UiModelInfo* ui_model_info(UiContext *ctx, ...); void ui_model_info_free(UiContext *ctx, UiModelInfo *mi);