diff --git a/gui_variable_tab.c b/gui_variable_tab.c index 7ec65ee..48be082 100644 --- a/gui_variable_tab.c +++ b/gui_variable_tab.c @@ -192,16 +192,20 @@ void gui_vartab_add_var(struct tdc_var *var) COL_TYPE, typestr, COL_NAME, var->name, -1); + + var->privdata = gtk_tree_iter_copy(&it); } void gui_vartab_update_var(struct tdc_var *var) { - // FIXME: don't update *all* columns when only *one* value changed - gtk_tree_model_foreach(GTK_TREE_MODEL(list_store), header_toggle_update, NULL); + /* do a dummy write to update cells */ + GtkTreeIter *it = (GtkTreeIter *)var->privdata; + gtk_list_store_set(list_store, it, -1); } void gui_vartab_remove_var(struct tdc_var *var) { - // FIXME: don't remove *all* columns when only *one* should be removed - gtk_list_store_clear(list_store); + GtkTreeIter *it = (GtkTreeIter *)var->privdata; + gtk_list_store_remove(list_store, it); + gtk_tree_iter_free(it); } diff --git a/tdc_variable.h b/tdc_variable.h index ec8f8b5..da18a92 100644 --- a/tdc_variable.h +++ b/tdc_variable.h @@ -15,6 +15,8 @@ struct tdc_var { float data_float; double data_double; }; + + void *privdata; char name[0]; };