File: boolean.scd

package info (click to toggle)
supercollider 1%3A3.4.5-1wheezy1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 26,972 kB
  • sloc: cpp: 116,645; lisp: 64,914; ansic: 10,725; python: 3,548; perl: 766; ruby: 487; sh: 152; makefile: 117; xml: 13
file content (19 lines) | stat: -rw-r--r-- 462 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19

// return booleans 
(
o = SCNSObject("NSWindow", "initWithContentRect:styleMask:backing:defer:", [Rect(100,540,400,200), 15, 2, 1]);
o.invoke("makeKeyAndOrderFront:", [nil], true);
)

c = 0; // window should close = false

o.setDelegate;
o.nsDelegate.addMethod("windowShouldClose:", "i", "@", { arg method, args; [method, args].postln;  ^c });

// try to close the window  then set c to 1
c = 1; // window should close = true


o.release;

SCNSObject.dumpPool;