1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
| void affichage_dessin(GtkWidget *Zone_dessin, GdkEventExpose *event, gpointer user_data)
{
cairo_t *context = NULL;
PangoLayout *layout = NULL;
context = gdk_cairo_create (Zone_dessin->window);
// 1ère ligne
cairo_set_source_rgb (context, 0, 0.7, 0);
layout = pango_layout_new (gtk_widget_get_pango_context (Zone_dessin));
pango_layout_set_text (layout, "A vous de jouer...", 18);
cairo_translate (context, 10, 20);
pango_cairo_show_layout (context, layout);
g_object_unref(layout);
cairo_destroy(context);
// 2ème ligne
context = gdk_cairo_create (Zone_dessin->window);
cairo_set_source_rgb (context, 0, 0, 1.0);
layout = pango_layout_new (gtk_widget_get_pango_context (Zone_dessin));
pango_layout_set_text (layout, "Motorisé par M3dlib", 20);
cairo_translate (context, Zone_dessin->allocation.width-150, Zone_dessin->allocation.height-20);
pango_cairo_show_layout (context, layout);
g_object_unref(layout);
cairo_destroy(context);
} |
Partager