Connexion between Pango.Layout and Gtk.TextBuffer

Hello there,

I have posted this question on the gtk-sharp mailing list but, maybe I
will get more lock here.

I'm browsing the documentation of Pango and Gtk for some time now and I
didn't find a clear "connexion" between a Gtk::TextBuffer and a

So, the question is :

Is there a way that a can populate a Gtk::TextBuffer with a string
formatted with markup's as the Pango::Layout.SetMarkup(string) can do.

For now, I plan to subclass a Gtk::TextBuffer (or a Gtk::TextView) and
a "void SetMarkup(string)" method that will parse the string and use a
bunch of TextTag to do the text formating internally. I also plan to add
a "string GetMarkup()" method witch will produce a string with markup's
from the content of the Gtk::TextBufer.

Is this a good way to go or there is already a simpler way to do what I
want ?

In fact, my goal is to create a simple wysiwyg text editor and render
the text produced on a Pango::Layout and then, on a Cairo::Surface.

Any thought ?


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]