26.05.2011 00:10, Vladimir Sedach пишет:
> I'm reading the GDK manual
> (http://developer.gnome.org/gdk/stable/gdk-Drawing-Primitives.html),
> and gdk_draw_text is marked as deprecated with the suggestion to use
> gdk_draw_layout instead. gdk_draw_layout is itself deprecated, but
> there is no recommendation for what should be used in its place. What
> is the right GDK function for drawing text, or is text drawing now
> moved outside of GDK?
> 
> Thank you,
> Vladimir
> _______________________________________________
> gtk-app-devel-list mailing list
> gtk-app-devel-list@gnome.org
> http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
> 
> 

gint draw_string (GdkDrawable *drawable,
                            GdkGC *gc,
                            gint x,
                            gint y,
                            const char *s)
{
  PangoLayout *layout;
  PangoContext *context;

  context = gdk_pango_context_get ();
  layout = pango_layout_new (context);
  pango_layout_set_text (layout, s, strlen (s));
  gdk_draw_layout (drawable, gc, x, y, layout);

  g_object_unref (layout);
  g_object_unref (context);

  return 0;
}

_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Reply via email to