https://developer.gnome.org/documentation/tutorials/beginners/getting_started/saving_files.html
Saving The Content To A File - GNOME Developer Documentation
In this lesson you will learn how to add a menu entry with a key shortcut, ask the user to select a file for saving the GtkTextBuffer contents, and save a file...
saving the contentdeveloper documentationfilegnome