Appendix C. Implementing Text Editing

Table of Contents

The Technique

Clutter provides a ClutterEntry actor for text entry. However, this is limited to single lines of text. Therefore you will need to implement your own custom actor if you need this functionality with multiple lines of text.

Like ClutterEntry you can use the Pango API - specifically the PangoLayout object. The PangoLayout can then be rendered to the clutter display in your ClutterActor::paint() implementation by using the pango_clutter_render_layout() utility function.

[Note] Note

However, pango_clutter_render_layout() is not official public Clutter API and could disappear in future version of Clutter. You may choose to investigate its implementation and reimplement it in your application. Future versions of Pango are likely to provide new API to make this easier.