deprecate SCViewHolder-layRight
[supercollider.git] / SCClassLibrary / Common / osx / objC / scide_scapp / SCWindowPlusCocoa.sc
blobf18dc766667857978e52c2f069815c8dd51b2642
1 + SCWindow{
2         dataptr{
3                 ^dataptr
4         }
5         asNSObject {
6                 ^dataptr.asNSReturn;
7         }
9         asNSWindow {
10                 var view, window;
11                 view = this.asNSObject;
12                 window = view.invoke("window");
13                 view.release;
14                 ^window; // you own it - call release one you do not need it anymore
15         }
17         visible {
18                 var ok, nsObj;
20                 if(isClosed, {^false});
22                 nsObj = this.asNSWindow;
23                 ok = nsObj.invoke("isVisible");
24                 nsObj.release;
26                 if(ok.isKindOf(Char), {
27                         ^(ok.ascii > 0); // 3.3 - BOOL is returned as Char
28                 }, {
29                         ^(ok > 0); // post 3.3 - BOOL is returned as Integer
30                 });
32                 ^false;
33         }
35         visible_ { |yorn|
36                 var nsObj;
38                 if(isClosed, {^this});
40                 nsObj = this.asNSWindow;
41                 if(yorn, {
42                         this.front;
43                 }, {
44                         nsObj.invoke("orderOut:", [nil], true);
45                 });
46                 nsObj.release;
47         }
49         unminimize {
50                 this.front;
51         }