Hi there,
Wx.stc.StyledTextCtrl
has SaveFile
and SetSavePoint
methods but I don’t see how to use the saved point. Is it possible to get a flag like need-not-save
after calling SetSavePoint
? (of course without re-opening the saved file and comparing the contents )
import wx
import wx.stc
class Frame(wx.Frame):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
ed = wx.stc.StyledTextCtrl(self)
ed.write("Hello, wxPython!")
print(ed.CanUndo()) # -> True (and need-save)
ed.SaveFile('temp.txt') # save and set the point
ed.SetSavePoint() # What is going on here?
print(ed.CanUndo()) # -> True (but need-not-save)
if __name__ == "__main__":
app = wx.App()
frm = Frame(None)
frm.Show()
app.MainLoop()