mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-13 05:50:10 +00:00
tests: Use draw signal in testinput
This commit is contained in:
parent
97b997d59e
commit
9cd83da6dc
@ -104,16 +104,11 @@ configure_event (GtkWidget *widget, GdkEventConfigure *event)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Refill the screen from the backing surface */
|
/* Refill the screen from the backing surface */
|
||||||
static gint
|
static gboolean
|
||||||
expose_event (GtkWidget *widget, GdkEventExpose *event)
|
draw (GtkWidget *widget, cairo_t *cr)
|
||||||
{
|
{
|
||||||
cairo_t *cr = gdk_cairo_create (gtk_widget_get_window (widget));
|
|
||||||
|
|
||||||
cairo_set_source_surface (cr, surface, 0, 0);
|
cairo_set_source_surface (cr, surface, 0, 0);
|
||||||
gdk_cairo_region (cr, event->region);
|
cairo_paint (cr);
|
||||||
cairo_fill (cr);
|
|
||||||
|
|
||||||
cairo_destroy (cr);
|
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
@ -325,8 +320,8 @@ main (int argc, char *argv[])
|
|||||||
|
|
||||||
/* Signals used to handle backing surface */
|
/* Signals used to handle backing surface */
|
||||||
|
|
||||||
g_signal_connect (drawing_area, "expose_event",
|
g_signal_connect (drawing_area, "draw",
|
||||||
G_CALLBACK (expose_event), NULL);
|
G_CALLBACK (draw), NULL);
|
||||||
g_signal_connect (drawing_area, "configure_event",
|
g_signal_connect (drawing_area, "configure_event",
|
||||||
G_CALLBACK (configure_event), NULL);
|
G_CALLBACK (configure_event), NULL);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user