The definition of newTextWindow in StringPlusGui.sc sets the default-value of the makeListener-argument to ‘false’ and then uses makeListener as the third argument in Document.new, where an Enviroment is expected (see Document | SuperCollider 3.14.0 Help).
// 1. create a NdefGui
Ndef(\1).gui;
// 2. Click Button "doc" in GUI "NdefGui_1"
// 3. Click into the newly created Document-Window "document-Ndef_1"
// 4. Click Button "doc" again in GUI "NdefGui_1"
ERROR: Message 'use' not understood.
Perhaps you misspelled 'cs', or meant to call 'use' on another receiver?
RECEIVER:
false
ARGS:
Instance of Function { (0x141090868, gc=6C, fmt=00, flg=00, set=02)
instance variables [2]
def : instance of FunctionDef in Method NodeProxy:asCode
context : Frame (0x170073d98) of NodeProxy:asCode
}
KEYWORD ARGUMENTS:
CALL STACK:
DoesNotUnderstandError:reportError
arg this = <instance of DoesNotUnderstandError>
Nil:handleError
arg this = nil
arg error = <instance of DoesNotUnderstandError>
Thread:handleError
arg this = <instance of Thread>
arg error = <instance of DoesNotUnderstandError>
Object:throw
arg this = <instance of DoesNotUnderstandError>
Object:doesNotUnderstand
arg this = false
arg selector = 'use'
arg args = [*1]
arg kwargs = [*0]
NodeProxy:asCode
arg this = <instance of Ndef>
arg includeSettings = true
arg includeMonitor = true
arg envir = false
var nameStr = nil
var srcStr = nil
var str = nil
var docStr = nil
var accessStr = "a"
var space = nil
var spaceCS = nil
var isAnon = nil
var isSingle = nil
var isInCurrent = nil
var isOnDefault = nil
var isMultiline = nil
NodeProxy:document
arg this = <instance of Ndef>
arg includeSettings = true
arg includeMonitor = true
var nameStr = "Ndef_1"
Button:doAction
arg this = <instance of Button>
arg modifiers = 0
Button:prDoAction
arg this = <instance of Button>
arg mods = 0
^^ ERROR: Message 'use' not understood.
Perhaps you misspelled 'cs', or meant to call 'use' on another receiver?
RECEIVER: false
Because envir = false Nodeproxy.asCode errors when sending it the message use.
Anybody knows what the function of makeListener in 'String:newTextWindow` should be?
Is it safe to change newTextWindow like so (this solves the described Problem with NdefGui)?
hm, also searching through downloaded quarks reveals that makeListener is used in scel-quark and makeListener = false appears several times. So this seems to be a more complex issue.
one last thing:
i think String.newTextWindow should be changed because "Test".newTextWindow creates a Document whose currentEnvironment returns false and that seems wrong to me.