# HG changeset patch # User Olaf Wintermann <olaf.wintermann@gmail.com> # Date 1741468211 -3600 # Node ID 1898cf608155b0b9e981b0b74e3bb7edfa101da0 # Parent 15a0cfe475954160918d94d3c724f9a5e2fa2414 add ui_listview_select/ui_combobox_select for gtk3 diff -r 15a0cfe47595 -r 1898cf608155 ui/gtk/list.c --- a/ui/gtk/list.c Sat Mar 08 22:06:25 2025 +0100 +++ b/ui/gtk/list.c Sat Mar 08 22:10:11 2025 +0100 @@ -851,6 +851,17 @@ return scroll_area; } +void ui_listview_select(UIWIDGET listview, int index) { + GtkTreeSelection *sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(listview)); + GtkTreePath *path = gtk_tree_path_new_from_indicesv(&index, 1); + gtk_tree_selection_select_path(sel, path); + //g_object_unref(path); +} + +void ui_combobox_select(UIWIDGET dropdown, int index) { + gtk_combo_box_set_active(GTK_COMBO_BOX(dropdown), index); +} + UIWIDGET ui_table_create(UiObject *obj, UiListArgs args) { UiObject* current = uic_current_obj(obj);