Re: TextBuffer tags



Yes, it requires a g<something>. You shall pass the returned pointer to g_free(). This is not ideal, of course. Gtk::TextBuffer::serialize() returns the same pointer as gtk_text_buffer_serialize(), without wrapping the pointer in a class.

Kjell

Den 2016-05-31 kl. 16:08, skrev Phil Wolff:
Thanks, Kjell, that's exactly what I need. However, I don't find anything that says how to dispose of the returned pointer. Do I delete [] it, or does it require a g<something> ()?

On 2016/05/29 07:01, Kjell Ahlstedt wrote:
Gtk::TextBuffer::serialize() and deserialize() are useful. They don't save anything, but they convert to and from a byte string that you can store in a file. Those methods were added to gtkmm in version 3.15.9. The corresponding gtk+ methods have existed much longer.

If you wonder why serialize() does not return a Glib::ustring or std::string, see https://bugzilla.gnome.org/show_bug.cgi?id=694250#c2

Kjell

On 2016-05-26 20:02, Phil Wolff wrote:
Is there a build-in way to save a TextBuffer (text content, tag definitions, where tags have been applied, marks, etc.), or do I have to roll my own?






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