+int process_selected(struct processtop *process)
+{
+ int i;
+ struct processtop *stored_process;
+
+ for (i = 0; i < selected_processes->len; i++) {
+ stored_process = g_ptr_array_index(selected_processes, i);
+ if (stored_process->tid == process->tid)
+ return 1;
+ }
+ return 0;
+}
+
+void update_selected_processes()
+{
+ if (process_selected(selected_process)) {
+ g_ptr_array_remove(selected_processes, selected_process);
+ print_log("Process removed");
+ } else {
+ g_ptr_array_add(selected_processes, selected_process);
+ print_log("Process added");
+ }
+}
+