[gtkmm] Persistant Markup Tags from Gtk::TextBuffer...



Hello,

This is sort of a gtkmm/libxml++ post. I hope it is not out of place on
this list.

My program is intended to create simple text documents with simple
formatting (bold, italics, etc). It saves these documents in an XML file
so that they will be read in on program startup with formatting intact.

At the moment, I have the formatting partially in place as far as the
Gtk::TextBuffer/TextView are concerned. I can see the bolded text in the
TextView. But when I export the file to XML, and read it back into the
program, the formatting is lost.

Do I need to manually detect the formatting when I save the document to
disk and insert the appropriate XML tags or is there a better way? Same
for reading, do I need to scan the XML file on disk for markup tags and
manually apply the tag in the TextBuffer as it is loaded? I guess I
don't really understand the format of the "tags" that GTK uses to markup
text.

As I'm sure this has been done many times before, maybe there is a
library that I should be using to read/write the XML data while
preserving the TextBuffer tags, or maybe I'm using the proper libraries
already, just not correctly.

Anyone here had much experience with such a task?

~djc




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