GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
+ colormap = gtk_widget_get_colormap (widget);
+
attributes.window_type = GDK_WINDOW_CHILD;
attributes.x = widget->allocation.x;
attributes.y = widget->allocation.y;
attributes.wclass = GDK_INPUT_OUTPUT;
attributes.visual = gtk_widget_get_visual (widget);
- attributes.colormap = gtk_widget_get_colormap (widget);
+ attributes.colormap = colormap;
attributes.event_mask = gtk_widget_get_events (widget);
attributes.event_mask |= (GDK_EXPOSURE_MASK |
gtk_style_set_background (widget->style, widget->window, GTK_STATE_NORMAL);
gdk_color_parse ("white", &sheet->color[BG_COLOR]);
- gdk_colormap_alloc_color (gdk_colormap_get_system (), &sheet->color[BG_COLOR], FALSE,
+ gdk_colormap_alloc_color (colormap, &sheet->color[BG_COLOR], FALSE,
TRUE);
gdk_color_parse ("gray", &sheet->color[GRID_COLOR]);
- gdk_colormap_alloc_color (gdk_colormap_get_system (), &sheet->color[GRID_COLOR], FALSE,
+ gdk_colormap_alloc_color (colormap, &sheet->color[GRID_COLOR], FALSE,
TRUE);
attributes.x = 0;
sheet->fg_gc = gdk_gc_new (widget->window);
sheet->bg_gc = gdk_gc_new (widget->window);
- colormap = gtk_widget_get_colormap (widget);
+
gdk_gc_get_values (sheet->fg_gc, &auxvalues);
static void
-gtk_sheet_unrealize (GtkWidget * widget)
+gtk_sheet_unrealize (GtkWidget *widget)
{
GtkSheet *sheet;
gdk_cursor_unref (sheet->cursor_drag);
sheet->cursor_drag = NULL;
- gdk_colormap_free_colors (gdk_colormap_get_system (),
- &sheet->color[BG_COLOR], 1);
-
- gdk_colormap_free_colors (gdk_colormap_get_system (),
- &sheet->color[GRID_COLOR], 1);
+ gdk_colormap_free_colors (gtk_widget_get_colormap (widget),
+ sheet->color, n_COLORS);
g_object_unref (sheet->xor_gc);
g_object_unref (sheet->fg_gc);
attributes->background = sheet->color[BG_COLOR];
if (!GTK_WIDGET_REALIZED (GTK_WIDGET (sheet)))
{
- GdkColormap *colormap;
- colormap = gdk_colormap_get_system ();
attributes->background = sheet->color[BG_COLOR];
}
attributes->justification = g_sheet_column_get_justification (sheet->column_geometry, col);