I am writing a note taking app with python and glade. I've been searching the web for the how to save and retrieve textbuffer with tags from simple app made with python and glade. I would like to get an in-depth answer as I am just starting to know python a little. So here's the situation:
Text loads fine, but tags that have been applied are lost upon opening the my editor again.
Heres my read,write solution on how to save and open file with textbuffer into textview:
def on_saver_clicked(self, widget): print "Saved" start, end = self.textbuffer.get_bounds() text = self.textbuffer.get_text(start, end, False) file = open("note.txt", "w") file.write(text) file.close() def on_opener_clicked(self, widget): print "Loaded" file = open("note.txt", "r") text = file.read() file.close() self.textbuffer.set_text(text)
Any ideas on how to save and retrieve the applied tags to the text? Also, could anybody tell me how to properly setup