--- a/ui/gtk/list.h Wed Sep 09 18:57:52 2026 +0200 +++ b/ui/gtk/list.h Thu Sep 10 17:36:06 2026 +0200 @@ -115,7 +115,8 @@ char *selection_action; } UiTreeEventData; -typedef struct UiListBox UiListBox; +typedef struct UiListBox UiListBox; +typedef struct UiListBox2 UiListBox2; typedef struct UiListBoxSubList { UiVar *var; @@ -144,11 +145,38 @@ UiSubListEventData current_eventdata; }; +struct UiListBox2 { + UiObject *obj; + GtkListBox *listbox; + UiVar *var; + CxList *rows; + ui_sourcelist_getvalue_func getvalue; + void *getvaluedata; + ui_tree_getdepthfunc getdepth; + void *getdepthdata; + + ui_callback onactivate; + void *onactivatedata; + char *onactivate_action; + ui_callback onbuttonclick; + void *onbuttonclickdata; + char *onbuttonclick_action; +}; + +typedef struct UiListBox2Row { + UiListBox2 *listbox; + CxList *children; // type: int (index) + int index; + int depth; + int expanded; +} UiListBox2Row; + void* ui_null_getvalue(UiList *list, void *elm, int row, int col, void *userdata, UiBool *freeResult); #if GTK_CHECK_VERSION(4, 10, 0) void ui_update_liststore(GListStore *liststore, UiList *list); +void ui_update_tree_liststore(GListStore *liststore, UiList *list); void ui_update_liststore_static(GListStore *liststore, char **elm, size_t nelm); void ui_listview_update_model(UiModel *model, void *userdata, int insert_index, int delete_index); @@ -214,17 +242,14 @@ void ui_listbox_row_activate(GtkListBox *self, GtkListBoxRow *row, gpointer user_data); -#if GTK_CHECK_VERSION(4, 10, 0) + +/* ------------------------------ SourceList2 ------------------------------ */ -typedef struct _ObjWrapper { - GObject parent_instance; - void *data; - int i; -} ObjWrapper; +void ui_listbox2_row_activate(GtkListBox *self, GtkListBoxRow *row, gpointer user_data); -ObjWrapper* ui_gobj_wrapper_new(void* data, int i); - -#endif +void ui_listbox2_update(UiList *list, int i); +UiListSelection ui_listbox2_getselection(UiList *list); +void ui_listbox2_setselection(UiList *list, UiListSelection selection); #ifdef __cplusplus }