Merge pull request #506 from andrewcsmith/patch-2
[supercollider.git] / editors / scapp / SCNSWindow.M
blob2c9c1bc45d28c3c10f6e7affafcde8564ef0696f
1 /*
3 SuperCollider real time audio synthesis system
4 Copyright (c) 2002 James McCartney. All rights reserved.
5 http://www.audiosynth.com
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23 #import "SCNSWindow.h"
24 #include <pthread.h>
25 #import "PyrSymbolTable.h"
26 #import "PyrLexer.h"
27 extern pthread_mutex_t gLangMutex;
29 @implementation SCNSWindow
30 - (BOOL) canBecomeKeyWindow { if(mHasBorders) return YES; else return [super canBecomeKeyWindow]; }
31 - (BOOL) hasBorders {return mHasBorders;}
32 - (void) setHasBorders: (BOOL) flag {mHasBorders = flag;}
33 - (void) setSCGraphView: (NSView*)view {mSCGraphView = view;}
34 - (NSView*) getSCGraphView {return mSCGraphView;}
35 - (IBAction) escape:(id)sender {
36 pthread_mutex_lock(&gLangMutex);
37 runLibrary(getsym("escapeWindow"));
38 pthread_mutex_unlock(&gLangMutex);
40 - (void)keyDown:(NSEvent *)event
42 if ([event keyCode] == 53)
44 [self escape:self];
45 } else [super keyDown:event];
47 @end