12 days ago
add ui_listview_select/ui_combobox_select for gtk3
ui/gtk/list.c | file | annotate | diff | comparison | revisions |
--- 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);