add ui_listview_select/ui_combobox_select for gtk3

12 days ago

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Sat, 08 Mar 2025 22:10:11 +0100 (12 days ago)
changeset 495
1898cf608155
parent 494
15a0cfe47595
child 496
190033250b21

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);
     

mercurial