[Gtk-sharp-list] Gtk TextBuffer Serialization & Deserialization

cyberzr cyberzr at gmail.com
Tue May 20 10:11:48 EDT 2008


Hi! 

I need to serialize and deserialize a TextBuffer for a project. But it
doesn't work. When serializing the TextBuffer and write it in a file, it
give me a file with only zeros.

The code:

BinaryWriter bw = new
BinaryWriter(File.Open("myfile",System.IO.FileMode.CreateNew));
byte[] data =
noteView.Buffer.Serialize(noteView.Buffer,Gdk.Atom.Intern("application/x-gtk-text-buffer-rich-text",true),noteView.Buffer.StartIter,noteView.Buffer.EndIter);
bw.Write(data);
bw.Close();

Does anyone have an example? I'll be happy ;)

++






More information about the Gtk-sharp-list mailing list