3 // used in methodReferences lookup
4 newTextWindow { arg title="Untitled", makeListener=false;
7 path = "temp_newTextWindow";
8 tempFile = File(path, "w");
11 ^path.openWinTextFile;
14 openTextFile { arg selectionStart=0, selectionLength=0;
15 ^this.openWinTextFile(selectionStart, selectionLength);
18 hackOpenWinTextFile { arg path, rangeStart, rangeSize;
19 _OpenWinTextFile ;//doc = Document.open(PathName(this).asAbsolutePath , selectionStart, selectionLength);
22 openWinTextFile{ arg selectionStart=0, selectionLength=0;
23 //hackOpenWinTextFile(PathName(this).asAbsolutePath , selectionStart, selectionLength); // standardizePath on win32 yet
24 hackOpenWinTextFile(this, selectionStart, selectionLength);
27 // windows expresses absolute paths differently from posix
30 sep = thisProcess.platform.pathSeparator;
31 // 2 styles of absolute path:
32 // C:\... or \\machine_name\...
33 if((this[0].isAlpha and: { this[1] == $: and: { this[2] == sep } })
34 or: { this[0] == sep and: { this[1] == sep } }) {
37 // let's also try to convert unix-style dirs
38 // assume starting from root dir of drive letter where SC is installed
39 if(this[0] == $/ and: { this[1] != $/ }) {
40 ^File.getcwd[..1] ++ this
42 // currently we can't support this on windows
43 // though it would be nice to have a primitive to get the user's home dir
44 // if(first == $~){^this.standardizePath};
45 ^File.getcwd ++ sep ++ this;
53 var sep = thisProcess.platform.pathSeparator;
54 ^(fullPath[0].isAlpha and: { fullPath[1] == $: and: { fullPath[2] == sep } })
55 or: { fullPath[0] == sep and: { fullPath[1] == sep } }
56 or: { fullPath[0] == $/ and: { fullPath[1] != $/ } }