+
+void
+gtk_math_view_control_data_set_root_selected(GtkMathViewControlData* cd, GdomeElement* elem)
+{
+ g_return_if_fail(cd != NULL);
+ GdomeException exc = 0;
+
+ gtk_math_view_freeze(cd->math_view);
+
+ if (cd->root_selected != NULL)
+ {
+ gtk_math_view_unselect(cd->math_view, cd->root_selected);
+ gdome_el_unref(cd->root_selected, &exc);
+ g_assert(exc == 0);
+ }
+
+ cd->root_selected = elem;
+ if (cd->root_selected != NULL)
+ {
+ gdome_el_ref(cd->root_selected, &exc);
+ g_assert(exc == 0);
+ gtk_math_view_select(cd->math_view, cd->root_selected);
+ }
+
+ gtk_math_view_thaw(cd->math_view);
+}