9 days ago
improve ui_listview_update2 and add todo for further improvements (GTK)
ui/gtk/list.c | file | annotate | diff | comparison | revisions |
--- a/ui/gtk/list.c Sun Mar 23 18:09:24 2025 +0100 +++ b/ui/gtk/list.c Sun Mar 23 18:21:45 2025 +0100 @@ -585,8 +585,9 @@ void *value = list->get(list, i); if(value) { ObjWrapper *obj = obj_wrapper_new(value); - g_list_store_remove(view->liststore, i); - g_list_store_insert(view->liststore, i, obj); + // TODO: if index i is selected, the selection is lost + // is it possible to update the item without removing it? + g_list_store_splice(view->liststore, i, 1, (void **)&obj, 1); } } }