Use new file dialogs.
diff --git a/Mac/Demo/waste/swed.py b/Mac/Demo/waste/swed.py
index 083a04c..c85cb21 100644
--- a/Mac/Demo/waste/swed.py
+++ b/Mac/Demo/waste/swed.py
@@ -14,7 +14,6 @@
from Carbon import Scrap
import os
import macfs
-import MACFS
UNDOLABELS = [ # Indexed by WEGetUndoInfo() value
None, "", "typing", "Cut", "Paste", "Clear", "Drag", "Style"]
@@ -213,7 +212,7 @@
try:
rf = Res.FSpOpenResFile(self.path, 3)
except Res.Error:
- Res.FSpCreateResFile(self.path, '????', 'TEXT', MACFS.smAllScripts)
+ Res.FSpCreateResFile(self.path, '????', 'TEXT', macfs.smAllScripts)
rf = Res.FSpOpenResFile(self.path, 3)
styles = Res.Resource('')
soup = Res.Resource('')
@@ -226,9 +225,9 @@
self.ted.WEResetModCount()
def menu_save_as(self):
- fss, ok = macfs.StandardPutFile('Save as:')
- if not ok: return
- self.path = fss.as_pathname()
+ path = EasyDialogs.AskFileForSave(message='Save as:')
+ if not path: return
+ self.path = path
self.name = os.path.split(self.path)[-1]
self.wid.SetWTitle(self.name)
self.menu_save()
@@ -521,10 +520,9 @@
def _open(self, askfile):
if askfile:
- fss, ok = macfs.StandardGetFile('TEXT')
- if not ok:
+ path = EasyDialogs.AskFileForOpen(typeList=('TEXT',))
+ if not path:
return
- path = fss.as_pathname()
name = os.path.split(path)[-1]
try:
fp = open(path, 'rb') # NOTE binary, we need cr as end-of-line