+ def GetWriteable(self):
+ """
+ Returns true if the document can be written to its accociated file path.
+ This method has been added to wxPython and is not in wxWindows.
+ """
+ if not self._writeable:
+ return False
+ if not self._documentFile: # Doesn't exist, do a save as
+ return True
+ else:
+ return os.access(self._documentFile, os.W_OK)
+
+
+ def SetWriteable(self, writeable):
+ """
+ Set to False if the document can not be saved. This will
+ disable the ID_SAVE_AS event and is useful for custom
+ documents that should not be saveable. The ID_SAVE event can
+ be disabled by never modifying the document.
+ """
+ self._writeable = writeable
+
+