optimize table view updates
This commit is contained in:
parent
f2ac3923e7
commit
5c4bf8d3b7
@ -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);
|
||||
}
|
||||
|
@ -15,6 +15,8 @@ struct tdc_var {
|
||||
float data_float;
|
||||
double data_double;
|
||||
};
|
||||
|
||||
void *privdata;
|
||||
char name[0];
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user