--- a/ui/motif/list.h Sun May 23 09:44:43 2021 +0200 +++ b/ui/motif/list.h Sat Jan 04 16:38:48 2025 +0100 @@ -38,24 +38,38 @@ #endif typedef struct UiListView { - Widget widget; - UiVar *list; + UiObject *obj; + Widget widget; + UiVar *var; + UiModel* model; ui_getvaluefunc getvalue; + + UiListSelection current_selection; + + ui_callback onactivate; + void* onactivatedata; + ui_callback onselection; + void* onselectiondata; + ui_callback ondragstart; + void* ondragstartdata; + ui_callback ondragcomplete; + void* ondragcompletedata; + ui_callback ondrop; + void* ondropsdata; + UiBool multiselection; } UiListView; -typedef struct UiListViewEventData { - UiEventData event; - UiVar *var; -} UiListViewEventData; +void ui_listview_destroy(Widget w, UiListView *listview, XtPointer d); + +void ui_listview_activate(Widget w, UiListView *listview, XmListCallbackStruct *cb); +void ui_listview_selection(Widget w, UiListView *listview, XmListCallbackStruct *cb); + +void ui_listview_update(UiList *list, int i); +UiListSelection ui_listview_getselection(UiList *list); +void ui_listview_setselection(UiList *list, UiListSelection selection); void* ui_strmodel_getvalue(void *elm, int column); -XmStringTable ui_create_stringlist(UiList *list, ui_getvaluefunc getvalue, int *count); -void ui_listview_update(UiEvent *event, UiListView *view); -void ui_list_selection_callback (Widget widget, UiListViewEventData *event, XtPointer data); - -UIWIDGET ui_combobox_var(UiObject *obj, UiVar *var, ui_getvaluefunc getvalue, ui_callback f, void *udata); - #ifdef __cplusplus } #endif