summaryrefslogtreecommitdiff
path: root/gtk/gtktoolpalette.c
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2010-09-06 13:56:26 +0200
committerBenjamin Otte <otte@redhat.com>2010-09-26 15:11:36 +0200
commita18ec3485c2abeac1ef9b4d33cfe6c9f61547e42 (patch)
tree5657c334f3fe615bcae458e25b3d080a9bbd242d /gtk/gtktoolpalette.c
parentf525837e3938168380adfbe545c5eff75c37d889 (diff)
downloadgtk+-a18ec3485c2abeac1ef9b4d33cfe6c9f61547e42.tar.gz
toolpalette: Port to draw vfunc
Diffstat (limited to 'gtk/gtktoolpalette.c')
-rw-r--r--gtk/gtktoolpalette.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/gtk/gtktoolpalette.c b/gtk/gtktoolpalette.c
index 98ac1d3740..7871734b59 100644
--- a/gtk/gtktoolpalette.c
+++ b/gtk/gtktoolpalette.c
@@ -616,13 +616,12 @@ gtk_tool_palette_size_allocate (GtkWidget *widget,
}
static gboolean
-gtk_tool_palette_expose_event (GtkWidget *widget,
- GdkEventExpose *event)
+gtk_tool_palette_draw (GtkWidget *widget,
+ cairo_t *cr)
{
GtkToolPalette *palette = GTK_TOOL_PALETTE (widget);
GdkDisplay *display;
GdkWindow *window;
- cairo_t *cr;
guint i;
window = gtk_widget_get_window (widget);
@@ -632,10 +631,6 @@ gtk_tool_palette_expose_event (GtkWidget *widget,
if (!gdk_display_supports_composite (display))
return FALSE;
- cr = gdk_cairo_create (window);
- gdk_cairo_region (cr, event->region);
- cairo_clip (cr);
-
cairo_push_group (cr);
for (i = 0; i < palette->priv->groups->len; ++i)
@@ -648,7 +643,6 @@ gtk_tool_palette_expose_event (GtkWidget *widget,
cairo_pop_group_to_source (cr);
cairo_paint (cr);
- cairo_destroy (cr);
return FALSE;
}
@@ -948,7 +942,7 @@ gtk_tool_palette_class_init (GtkToolPaletteClass *cls)
wclass->size_request = gtk_tool_palette_size_request;
wclass->size_allocate = gtk_tool_palette_size_allocate;
- wclass->expose_event = gtk_tool_palette_expose_event;
+ wclass->draw = gtk_tool_palette_draw;
wclass->realize = gtk_tool_palette_realize;
cclass->add = gtk_tool_palette_add;