static void remove_selected_nodes(void) { GtkCList *clist = GTK_CLIST(gui_main_window_lookup("clist_nodes")); GSList *node_list; g_assert(clist != NULL); node_list = clist_collect_data(clist, TRUE, NULL); guc_node_remove_nodes_by_id(node_list); g_slist_free(node_list); }
/** * Removes all selected nodes from the treeview and disconnects them. */ void nodes_gui_remove_selected(void) { GtkTreeView *treeview; GtkTreeSelection *selection; GSList *node_list = NULL; treeview = GTK_TREE_VIEW(gui_main_window_lookup("treeview_nodes")); selection = gtk_tree_view_get_selection(treeview); gtk_tree_selection_selected_foreach(selection, nodes_gui_remove_selected_helper, &node_list); guc_node_remove_nodes_by_id(node_list); g_slist_free(node_list); }