{
gint width;
g_object_set (G_OBJECT (renderer), "text", string, (void *) NULL);
- gtk_cell_renderer_get_size (renderer, GTK_WIDGET (treeview),
- NULL, NULL, NULL, &width, NULL);
+ gtk_cell_renderer_get_preferred_width (renderer, GTK_WIDGET (treeview),
+ NULL, &width);
+
return width;
}
{
gtk_widget_queue_resize (GTK_WIDGET (data_sheet));
data_sheet->scroll_to_bottom_signal =
- g_signal_connect (data_sheet, "size-request",
+ g_signal_connect (data_sheet, "size-allocate",
G_CALLBACK (scroll_to_bottom), NULL);
}
else
var = g_object_get_data (G_OBJECT (column), "variable");
g_return_if_fail (var != NULL);
- if (var_has_value_labels (var))
+ if (data_sheet->show_value_labels && var_has_value_labels (var))
{
cell = gtk_cell_renderer_combo_new ();
g_object_set (G_OBJECT (cell),
{
ds->show_value_labels = show_value_labels;
g_object_notify (G_OBJECT (ds), "value-labels");
- gtk_widget_queue_draw (GTK_WIDGET (ds));
- /* Make the cell being edited refresh too. */
- pspp_sheet_view_stop_editing (PSPP_SHEET_VIEW (ds), TRUE);
+ /* Pretend the model changed, to force the columns to be rebuilt.
+ Otherwise cell renderers won't get changed from combo boxes to text
+ entries or vice versa. */
+ g_object_notify (G_OBJECT (ds), "model");
}
}
g_assert_not_reached ();
}
- gtk_selection_data_set (selection_data, selection_data->target,
+ gtk_selection_data_set (selection_data, gtk_selection_data_get_target (selection_data),
8,
(const guchar *) string->str, string->len);
gint first_column;
char *c;
- if ( sd->length < 0 )
+ if ( gtk_selection_data_get_length (sd) < 0 )
return;
- if ( sd->type != gdk_atom_intern ("UTF8_STRING", FALSE))
+ if ( gtk_selection_data_get_data_type (sd) != gdk_atom_intern ("UTF8_STRING", FALSE))
return;
- c = (char *) sd->data;
+ c = (char *) gtk_selection_data_get_data (sd);
/* Get the starting selected position in the data sheet. (Possibly we should
only paste into the selected range if it's larger than one cell?) */
g_return_if_fail (next_row >= 0);
g_return_if_fail (next_column >= 0);
- while (count < sd->length)
+ while (count < gtk_selection_data_get_length (sd))
{
gint row = next_row;
gint column = next_column;
struct variable *var;
char *s = c;
- while (*c != '\t' && *c != '\n' && count < sd->length)
+ while (*c != '\t' && *c != '\n' && count < gtk_selection_data_get_length (sd))
{
c++;
count++;