From: briand at aracnet.com MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16686.534.480892.237104 at soggy.deldotd.com> Date: Thu, 26 Aug 2004 08:30:30 -0700 To: Jacques GARRIGUE Cc: lablgtk at kaba.or.jp Subject: Re: how to put text in a drawing_area ? In-Reply-To: <20040826.165052.74190188.garrigue at kurims.kyoto-u.ac.jp> References: <16685.28897.429085.9744 at soggy.deldotd.com> <20040826.165052.74190188.garrigue@kurims.kyoto-u.ac.jp> It helps ! Works just fine. I think a simpler utility method would be great. I'll volunteer. Le me know if this is something you have already given thought to, otherwise I'll try to come up with some sort of proposal and see what you think. Thank You Brian >>>>> "Jacques" == Jacques GARRIGUE writes: Jacques> From: briand@aracnet.com >> Seems like a very simple thing and in fact gDraw.mli contains the >> following comment : >> >> >> (** Functions for drawing points, lines, arcs, and text @gtkdoc >> gdk gdk-Drawing-Primitives *) >> >> >> However there is no text method and I can't seem to trace out a >> link to the regular text widgets, nor can I find anything in the >> examples directory... Jacques> You need to use the #put_layout method. But for that you Jacques> must first create a layout with: Jacques> let layout = area#misc#pango_context#create_layout in Jacques> Then you write in the layout, before drawing it: Jacques> Pango.Layout.set_text layout "my text"; Jacques> drawable#put_layout layout ~x:10 ~y:10 Jacques> Hope this helps. Jacques> Jacques Jacques> P.S. maybe we could add a simpler utility method...