tree_view->priv->selected = NULL;
}
- if (tree_view->priv->columns != NULL)
- {
- list = tree_view->priv->columns;
- while (list)
- {
- PsppSheetViewColumn *column;
- column = PSPP_SHEET_VIEW_COLUMN (list->data);
- list = list->next;
- pspp_sheet_view_remove_column (tree_view, column);
- }
- tree_view->priv->columns = NULL;
- }
tree_view->priv->prelight_node = -1;
for (x = 0 ; x < 5 ; ++x)
g_object_unref (priv->grid_line_gc[x]);
+ if (tree_view->priv->columns != NULL)
+ {
+ list = tree_view->priv->columns;
+ while (list)
+ {
+ PsppSheetViewColumn *column;
+ column = PSPP_SHEET_VIEW_COLUMN (list->data);
+ list = list->next;
+ pspp_sheet_view_remove_column (tree_view, column);
+ }
+ tree_view->priv->columns = NULL;
+ }
+
GTK_WIDGET_CLASS (pspp_sheet_view_parent_class)->unrealize (widget);
}
}
if (tree_view->priv->n_columns == 0 &&
- pspp_sheet_view_get_headers_visible (tree_view))
+ pspp_sheet_view_get_headers_visible (tree_view) &&
+ tree_view->priv->header_window)
gdk_window_hide (tree_view->priv->header_window);
gtk_widget_queue_resize (GTK_WIDGET (tree_view));
de->font = NULL;
de->ui_manager = NULL;
+ de->old_vbox_widget = NULL;
g_object_set (de, "tab-pos", GTK_POS_BOTTOM, NULL);
PSPP_SHEET_VIEW (de->data_sheets[0]));
disconnect_data_sheets (de);
- gtk_widget_destroy (de->datasheet_vbox_widget);
+ if (de->old_vbox_widget)
+ g_object_unref (de->old_vbox_widget);
+ de->old_vbox_widget = de->datasheet_vbox_widget;
+ g_object_ref (de->old_vbox_widget);
+ gtk_container_remove (de->vbox, de->datasheet_vbox_widget);
if (split)
de->datasheet_vbox_widget = make_split_datasheet (de, grid_lines);
else
de->datasheet_vbox_widget = make_single_datasheet (de, grid_lines);
+
psppire_data_editor_refresh_model (de);
gtk_box_pack_start (GTK_BOX (de->vbox), de->datasheet_vbox_widget,
/* UI manager for whichever var or data sheet is currently in use. */
GtkUIManager *ui_manager;
+ GtkWidget *old_vbox_widget;
};
struct _PsppireDataEditorClass
gtk_window_remove_accel_group (GTK_WINDOW (pdw),
gtk_ui_manager_get_accel_group (uim));
-
- /* Our caller unrefs 'uim', possibly causing 'uim' to be freed. The
- following call appears to be necessary to ensure that pdw->ui_manager
- drops all references to 'uim'. Otherwise, I get valgrind complaints about
- access to freed memory (and segfaults) on e.g. Windows|Split View. */
- gtk_ui_manager_ensure_update (pdw->ui_manager);
}
GtkWidget*