-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDrawErrorController.m
83 lines (58 loc) · 1.46 KB
/
DrawErrorController.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
//
// DrawErrorController.m
// DrawError
//
// Created by Nicole Lehrer on 1/13/09.
// Copyright 2009 ASU. All rights reserved.
//
#import "DrawErrorController.h"
#import "DrawError.h"
#import "GNUstep.h"
#import "Log.h"
static DrawErrorController * gDrawErrorWindow = nil;
@implementation DrawErrorController
@synthesize drawError;
@synthesize firstResp;
#pragma mark -
#pragma mark class methods
+ (void) initialize
{
if ( self == [DrawErrorController class] ) {
gDrawErrorWindow = nil;
}
}
+ (DrawErrorController *) windowController
{
if (gDrawErrorWindow != nil) return gDrawErrorWindow;
gDrawErrorWindow = [[DrawErrorController alloc] init];
return gDrawErrorWindow;
}
+ (void) showWindowController:(id)sender
{
if (gDrawErrorWindow == nil) [DrawErrorController windowController];
NSScreen * menuScreen = [[NSScreen screens] objectAtIndex:0];
NSRect screenRect = [menuScreen frame];
[[gDrawErrorWindow window] setFrameOrigin:screenRect.origin];
[gDrawErrorWindow showWindow:sender];
}
#pragma mark -
#pragma mark initializer
// designated initializer
- (id) init
{
if (gDrawErrorWindow) return gDrawErrorWindow;
self = [super initWithWindowNibName:@"DrawError"];
if (self == nil) {
logError( @"DrawErrorController super init failed" );
return nil;
}
return self;
}
#pragma mark -
#pragma mark instance methods
- (void) awakeFromNib
{
logDebug( @"awakeFromNib" );
[[self window] setInitialFirstResponder:firstResp];
}
@end